2013-01-02 03:15:03 +01:00
|
|
|
<?php
|
|
|
|
|
2015-01-02 05:27:45 +01:00
|
|
|
final class PhabricatorInvalidConfigSetupCheck extends PhabricatorSetupCheck {
|
2013-01-02 03:15:03 +01:00
|
|
|
|
2015-02-10 21:53:00 +01:00
|
|
|
public function getDefaultGroup() {
|
|
|
|
return self::GROUP_OTHER;
|
|
|
|
}
|
|
|
|
|
2013-01-02 03:15:03 +01:00
|
|
|
protected function executeChecks() {
|
|
|
|
$groups = PhabricatorApplicationConfigOptions::loadAll();
|
|
|
|
foreach ($groups as $group) {
|
|
|
|
$options = $group->getOptions();
|
|
|
|
foreach ($options as $option) {
|
|
|
|
try {
|
|
|
|
$group->validateOption(
|
|
|
|
$option,
|
2013-01-18 01:25:38 +01:00
|
|
|
PhabricatorEnv::getUnrepairedEnvConfig($option->getKey()));
|
2013-01-02 03:15:03 +01:00
|
|
|
} catch (PhabricatorConfigValidationException $ex) {
|
|
|
|
$this
|
|
|
|
->newIssue('config.invalid.'.$option->getKey())
|
|
|
|
->setName(pht("Config '%s' Invalid", $option->getKey()))
|
|
|
|
->setMessage(
|
|
|
|
pht(
|
2013-01-18 01:25:38 +01:00
|
|
|
"Configuration option '%s' has invalid value and ".
|
|
|
|
"was restored to the default: %s",
|
2013-01-02 03:15:03 +01:00
|
|
|
$option->getKey(),
|
|
|
|
$ex->getMessage()))
|
|
|
|
->addPhabricatorConfig($option->getKey());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|