Page MenuHomePhabricator

D10787.diff
No OneTemporary

D10787.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -1455,6 +1455,7 @@
'PhabricatorConfigSchemaQuery' => 'applications/config/schema/PhabricatorConfigSchemaQuery.php',
'PhabricatorConfigSchemaSpec' => 'applications/config/schema/PhabricatorConfigSchemaSpec.php',
'PhabricatorConfigServerSchema' => 'applications/config/schema/PhabricatorConfigServerSchema.php',
+ 'PhabricatorConfigSiteSource' => 'infrastructure/env/PhabricatorConfigSiteSource.php',
'PhabricatorConfigSource' => 'infrastructure/env/PhabricatorConfigSource.php',
'PhabricatorConfigStackSource' => 'infrastructure/env/PhabricatorConfigStackSource.php',
'PhabricatorConfigStorageSchema' => 'applications/config/schema/PhabricatorConfigStorageSchema.php',
@@ -4534,6 +4535,7 @@
'PhabricatorConfigSchemaQuery' => 'Phobject',
'PhabricatorConfigSchemaSpec' => 'Phobject',
'PhabricatorConfigServerSchema' => 'PhabricatorConfigStorageSchema',
+ 'PhabricatorConfigSiteSource' => 'PhabricatorConfigProxySource',
'PhabricatorConfigStackSource' => 'PhabricatorConfigSource',
'PhabricatorConfigStorageSchema' => 'Phobject',
'PhabricatorConfigTableSchema' => 'PhabricatorConfigStorageSchema',
diff --git a/src/infrastructure/env/PhabricatorConfigSiteSource.php b/src/infrastructure/env/PhabricatorConfigSiteSource.php
new file mode 100644
--- /dev/null
+++ b/src/infrastructure/env/PhabricatorConfigSiteSource.php
@@ -0,0 +1,17 @@
+<?php
+
+/**
+ * Optional configuration source which loads between local sources and the
+ * database source.
+ *
+ * Subclasses of this source can read external configuration sources (like a
+ * remote server).
+ */
+abstract class PhabricatorConfigSiteSource
+ extends PhabricatorConfigProxySource {
+
+ public function getPriority() {
+ return 1000.0;
+ }
+
+}
diff --git a/src/infrastructure/env/PhabricatorEnv.php b/src/infrastructure/env/PhabricatorEnv.php
--- a/src/infrastructure/env/PhabricatorEnv.php
+++ b/src/infrastructure/env/PhabricatorEnv.php
@@ -153,6 +153,15 @@
// pull in all options from non-phabricator libraries now they are loaded.
$default_source->loadExternalOptions();
+ // If this install has site config sources, load them now.
+ $site_sources = id(new PhutilSymbolLoader())
+ ->setAncestorClass('PhabricatorConfigSiteSource')
+ ->loadObjects();
+ $site_sources = msort($site_sources, 'getPriority');
+ foreach ($site_sources as $site_source) {
+ $stack->pushSource($site_source);
+ }
+
try {
$stack->pushSource(
id(new PhabricatorConfigDatabaseSource('default'))

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 1:38 PM (6 h, 46 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6910566
Default Alt Text
D10787.diff (2 KB)

Event Timeline