当前位置: 首页>>代码示例>>PHP>>正文


PHP PhabricatorEnv::sourceStack方法代码示例

本文整理汇总了PHP中PhabricatorEnv::sourceStack方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorEnv::sourceStack方法的具体用法?PHP PhabricatorEnv::sourceStack怎么用?PHP PhabricatorEnv::sourceStack使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhabricatorEnv的用法示例。


在下文中一共展示了PhabricatorEnv::sourceStack方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: buildConfigurationSourceStack

 private static function buildConfigurationSourceStack($config_optional)
 {
     self::dropConfigCache();
     $stack = new PhabricatorConfigStackSource();
     self::$sourceStack = $stack;
     $default_source = id(new PhabricatorConfigDefaultSource())->setName(pht('Global Default'));
     $stack->pushSource($default_source);
     $env = self::getSelectedEnvironmentName();
     if ($env) {
         $stack->pushSource(id(new PhabricatorConfigFileSource($env))->setName(pht("File '%s'", $env)));
     }
     $stack->pushSource(id(new PhabricatorConfigLocalSource())->setName(pht('Local Config')));
     // If the install overrides the database adapter, we might need to load
     // the database adapter class before we can push on the database config.
     // This config is locked and can't be edited from the web UI anyway.
     foreach (self::getEnvConfig('load-libraries') as $library) {
         phutil_load_library($library);
     }
     // If custom libraries specify config options, they won't get default
     // values as the Default source has already been loaded, so we get it to
     // 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 PhutilClassMapQuery())->setAncestorClass('PhabricatorConfigSiteSource')->setSortMethod('getPriority')->execute();
     foreach ($site_sources as $site_source) {
         $stack->pushSource($site_source);
     }
     $master = PhabricatorDatabaseRef::getMasterDatabaseRef();
     if (!$master) {
         self::setReadOnly(true, self::READONLY_MASTERLESS);
     } else {
         if ($master->isSevered()) {
             $master->checkHealth();
             if ($master->isSevered()) {
                 self::setReadOnly(true, self::READONLY_SEVERED);
             }
         }
     }
     try {
         $stack->pushSource(id(new PhabricatorConfigDatabaseSource('default'))->setName(pht('Database')));
     } catch (AphrontSchemaQueryException $exception) {
         // If the database is not available, just skip this configuration
         // source. This happens during `bin/storage upgrade`, `bin/conf` before
         // schema setup, etc.
     } catch (AphrontConnectionQueryException $ex) {
         if (!$config_optional) {
             throw $ex;
         }
     } catch (AphrontInvalidCredentialsQueryException $ex) {
         if (!$config_optional) {
             throw $ex;
         }
     }
 }
开发者ID:endlessm,项目名称:phabricator,代码行数:54,代码来源:PhabricatorEnv.php

示例2: buildConfigurationSourceStack

 private static function buildConfigurationSourceStack()
 {
     self::dropConfigCache();
     $stack = new PhabricatorConfigStackSource();
     self::$sourceStack = $stack;
     $default_source = id(new PhabricatorConfigDefaultSource())->setName(pht('Global Default'));
     $stack->pushSource($default_source);
     $env = self::getSelectedEnvironmentName();
     if ($env) {
         $stack->pushSource(id(new PhabricatorConfigFileSource($env))->setName(pht("File '%s'", $env)));
     }
     $stack->pushSource(id(new PhabricatorConfigLocalSource())->setName(pht('Local Config')));
     // If the install overrides the database adapter, we might need to load
     // the database adapter class before we can push on the database config.
     // This config is locked and can't be edited from the web UI anyway.
     foreach (self::getEnvConfig('load-libraries') as $library) {
         phutil_load_library($library);
     }
     // If custom libraries specify config options, they won't get default
     // values as the Default source has already been loaded, so we get it to
     // 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'))->setName(pht('Database')));
     } catch (AphrontQueryException $exception) {
         // If the database is not available, just skip this configuration
         // source. This happens during `bin/storage upgrade`, `bin/conf` before
         // schema setup, etc.
     }
 }
开发者ID:JohnnyEstilles,项目名称:phabricator,代码行数:36,代码来源:PhabricatorEnv.php

示例3: buildConfigurationSourceStack

 private static function buildConfigurationSourceStack($config_optional)
 {
     self::dropConfigCache();
     $stack = new PhabricatorConfigStackSource();
     self::$sourceStack = $stack;
     $default_source = id(new PhabricatorConfigDefaultSource())->setName(pht('Global Default'));
     $stack->pushSource($default_source);
     $env = self::getSelectedEnvironmentName();
     if ($env) {
         $stack->pushSource(id(new PhabricatorConfigFileSource($env))->setName(pht("File '%s'", $env)));
     }
     $stack->pushSource(id(new PhabricatorConfigLocalSource())->setName(pht('Local Config')));
     // If the install overrides the database adapter, we might need to load
     // the database adapter class before we can push on the database config.
     // This config is locked and can't be edited from the web UI anyway.
     foreach (self::getEnvConfig('load-libraries') as $library) {
         phutil_load_library($library);
     }
     // Drop any class map caches, since they will have generated without
     // any classes from libraries. Without this, preflight setup checks can
     // cause generation of a setup check cache that omits checks defined in
     // libraries, for example.
     PhutilClassMapQuery::deleteCaches();
     // If custom libraries specify config options, they won't get default
     // values as the Default source has already been loaded, so we get it to
     // 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 PhutilClassMapQuery())->setAncestorClass('PhabricatorConfigSiteSource')->setSortMethod('getPriority')->execute();
     foreach ($site_sources as $site_source) {
         $stack->pushSource($site_source);
     }
     $masters = PhabricatorDatabaseRef::getMasterDatabaseRefs();
     if (!$masters) {
         self::setReadOnly(true, self::READONLY_MASTERLESS);
     } else {
         // If any master is severed, we drop to readonly mode. In theory we
         // could try to continue if we're only missing some applications, but
         // this is very complex and we're unlikely to get it right.
         foreach ($masters as $master) {
             // Give severed masters one last chance to get healthy.
             if ($master->isSevered()) {
                 $master->checkHealth();
             }
             if ($master->isSevered()) {
                 self::setReadOnly(true, self::READONLY_SEVERED);
                 break;
             }
         }
     }
     try {
         $stack->pushSource(id(new PhabricatorConfigDatabaseSource('default'))->setName(pht('Database')));
     } catch (AphrontSchemaQueryException $exception) {
         // If the database is not available, just skip this configuration
         // source. This happens during `bin/storage upgrade`, `bin/conf` before
         // schema setup, etc.
     } catch (AphrontConnectionQueryException $ex) {
         if (!$config_optional) {
             throw $ex;
         }
     } catch (AphrontInvalidCredentialsQueryException $ex) {
         if (!$config_optional) {
             throw $ex;
         }
     }
 }
开发者ID:NeoArmageddon,项目名称:phabricator,代码行数:66,代码来源:PhabricatorEnv.php


注:本文中的PhabricatorEnv::sourceStack方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。