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


PHP PhabricatorEnv::getUnrepairedEnvConfig方法代码示例

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


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

示例1: executeChecks

 protected function executeChecks()
 {
     $groups = PhabricatorApplicationConfigOptions::loadAll();
     foreach ($groups as $group) {
         $options = $group->getOptions();
         foreach ($options as $option) {
             try {
                 $group->validateOption($option, PhabricatorEnv::getUnrepairedEnvConfig($option->getKey()));
             } catch (PhabricatorConfigValidationException $ex) {
                 $this->newIssue('config.invalid.' . $option->getKey())->setName(pht("Config '%s' Invalid", $option->getKey()))->setMessage(pht("Configuration option '%s' has invalid value and " . "was restored to the default: %s", $option->getKey(), $ex->getMessage()))->addPhabricatorConfig($option->getKey());
             }
         }
     }
 }
开发者ID:pugong,项目名称:phabricator,代码行数:14,代码来源:PhabricatorInvalidConfigSetupCheck.php

示例2: renderPhabricatorConfig

 private function renderPhabricatorConfig(array $configs, $related = false)
 {
     $issue = $this->getIssue();
     $table_info = phutil_tag('p', array(), pht('The current Phabricator configuration has these %d value(s):', count($configs)));
     $options = PhabricatorApplicationConfigOptions::loadAllOptions();
     $hidden = array();
     foreach ($options as $key => $option) {
         if ($option->getHidden()) {
             $hidden[$key] = true;
         }
     }
     $table = null;
     $dict = array();
     foreach ($configs as $key) {
         if (isset($hidden[$key])) {
             $dict[$key] = null;
         } else {
             $dict[$key] = PhabricatorEnv::getUnrepairedEnvConfig($key);
         }
     }
     $table = $this->renderValueTable($dict, $hidden);
     if ($this->getIssue()->getIsFatal()) {
         $update_info = phutil_tag('p', array(), pht('To update these %d value(s), run these command(s) from the command ' . 'line:', count($configs)));
         $update = array();
         foreach ($configs as $key) {
             $update[] = hsprintf('<tt>phabricator/ $</tt> ./bin/config set %s <em>value</em>', $key);
         }
         $update = phutil_tag('pre', array(), phutil_implode_html("\n", $update));
     } else {
         $update = array();
         foreach ($configs as $config) {
             if (idx($options, $config) && $options[$config]->getLocked()) {
                 $name = pht('View "%s"', $config);
             } else {
                 $name = pht('Edit "%s"', $config);
             }
             $link = phutil_tag('a', array('href' => '/config/edit/' . $config . '/?issue=' . $issue->getIssueKey()), $name);
             $update[] = phutil_tag('li', array(), $link);
         }
         if ($update) {
             $update = phutil_tag('ul', array(), $update);
             if (!$related) {
                 $update_info = phutil_tag('p', array(), pht('You can update these %d value(s) here:', count($configs)));
             } else {
                 $update_info = phutil_tag('p', array(), pht('These %d configuration value(s) are related:', count($configs)));
             }
         } else {
             $update = null;
             $update_info = null;
         }
     }
     return phutil_tag('div', array('class' => 'setup-issue-config'), array($table_info, $table, $update_info, $update));
 }
开发者ID:NeoArmageddon,项目名称:phabricator,代码行数:53,代码来源:PhabricatorSetupIssueView.php


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