1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-14 19:02:41 +01:00
phorge-phorge/src/infrastructure/env/PhabricatorConfigDefaultSource.php
Asher Baker da9315b145 Read default values of custom config options
Summary: Because the Default configuration provider is loaded before custom libraries, any config options specified in them don't get a default values.

Test Plan: Looked at /config/

Reviewers: epriestley, codeblock, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4532
2013-01-19 08:36:08 -08:00

22 lines
634 B
PHP

<?php
/**
* Configuration source which reads from defaults defined in the authoritative
* configuration definitions.
*/
final class PhabricatorConfigDefaultSource
extends PhabricatorConfigProxySource {
public function __construct() {
$options = PhabricatorApplicationConfigOptions::loadAllOptions();
$options = mpull($options, 'getDefault');
$this->setSource(new PhabricatorConfigDictionarySource($options));
}
public function loadExternalOptions() {
$options = PhabricatorApplicationConfigOptions::loadAllOptions(true);
$options = mpull($options, 'getDefault');
$this->setKeys($options);
}
}