mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-13 18:32:41 +01:00
8a52a6d585
Summary: Also improve behavior for the "unknown config" warning. Test Plan: Looked at configs, went through unknown config workflow. Reviewers: btrahan, codeblock Reviewed By: btrahan CC: aran Maniphest Tasks: T2255 Differential Revision: https://secure.phabricator.com/D4310
32 lines
1 KiB
PHP
32 lines
1 KiB
PHP
<?php
|
|
|
|
final class PhabricatorSetupCheckExtraConfig extends PhabricatorSetupCheck {
|
|
|
|
protected function executeChecks() {
|
|
$all_keys = PhabricatorEnv::getAllConfigKeys();
|
|
$all_keys = array_keys($all_keys);
|
|
sort($all_keys);
|
|
|
|
$defined_keys = PhabricatorApplicationConfigOptions::loadAllOptions();
|
|
|
|
foreach ($all_keys as $key) {
|
|
if (isset($defined_keys[$key])) {
|
|
continue;
|
|
}
|
|
$summary = pht("This option is not recognized. It may be misspelled.");
|
|
$message = pht(
|
|
"The configuration option '%s' is not recognized. It may be ".
|
|
"misspelled, or it might have existed in an older version of ".
|
|
"Phabricator. It has no effect, and should be corrected or deleted.",
|
|
$key);
|
|
|
|
$this
|
|
->newIssue('config.unknown.'.$key)
|
|
->setShortName(pht('Unknown Config'))
|
|
->setName(pht('Unknown Configuration Option "%s"', $key))
|
|
->setSummary($summary)
|
|
->setMessage($message)
|
|
->addPhabricatorConfig($key);
|
|
}
|
|
}
|
|
}
|