Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/infrastructure/env/PhabricatorConfigDatabaseSource.php
12241 views
1
<?php
2
3
final class PhabricatorConfigDatabaseSource
4
extends PhabricatorConfigProxySource {
5
6
public function __construct($namespace) {
7
$config = $this->loadConfig($namespace);
8
$this->setSource(new PhabricatorConfigDictionarySource($config));
9
}
10
11
public function isWritable() {
12
// While this is writable, writes occur through the Config application.
13
return false;
14
}
15
16
private function loadConfig($namespace) {
17
$objects = id(new PhabricatorConfigEntry())->loadAllWhere(
18
'namespace = %s AND isDeleted = 0',
19
$namespace);
20
return mpull($objects, 'getValue', 'getConfigKey');
21
}
22
23
}
24
25