1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-28 09:42:41 +01:00
phorge-phorge/src/applications/config/check/PhabricatorInvalidConfigSetupCheck.php
Chad Little b701313e0e Split Setup Issues into Groups
Summary: Groups setup issues into Important, PHP, MySQL, and Base for easier parsing on initial installations.

Test Plan:
Test my internal server and various issues.

{F289699}

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7207

Differential Revision: https://secure.phabricator.com/D11726
2015-02-10 12:53:00 -08:00

34 lines
1 KiB
PHP

<?php
final class PhabricatorInvalidConfigSetupCheck extends PhabricatorSetupCheck {
public function getDefaultGroup() {
return self::GROUP_OTHER;
}
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());
}
}
}
}
}