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()); } } } }
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)); }