當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。