1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-11 17:32:41 +01:00
phorge-phorge/src/applications/config/check/PhabricatorSetupCheckTimezone.php
epriestley c32295aab6 Improve resolution process for nonfatal setup issues
Summary:
  - When a setup issue is nonfatal (i.e., a warning), instruct the user to edit the value from the web UI instead of using `bin/config`.
  - When the user edits configuration in response to a setup issue, send them back to the issue when they're done.
  - When an issue relates to PHP configuration, link to the PHP documentation on configuration.
  - Add new-style setup check for timezone issues.

Test Plan: Mucked with my timezone config, resolved the issues I created.

Reviewers: codeblock, btrahan, vrana

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2221, T2228

Differential Revision: https://secure.phabricator.com/D4298
2012-12-30 17:04:38 -08:00

31 lines
991 B
PHP

<?php
final class PhabricatorSetupCheckTimezone extends PhabricatorSetupCheck {
protected function executeChecks() {
$timezone = nonempty(
PhabricatorEnv::getEnvConfig('phabricator.timezone'),
ini_get('date.timezone'));
if ($timezone) {
return;
}
$summary = pht(
"Without a configured timezone, PHP will emit warnings when working ".
"with dates, and dates and times may not display correctly.");
$message = pht(
"Your configuration fails to specify a server timezone. You can either ".
"set the PHP configuration value 'date.timezone' or the Phabricator ".
"configuration value 'phabricator.timezone' to specify one.");
$this
->newIssue('config.timezone')
->setShortName(pht('Timezone'))
->setName(pht('Server Timezone Not Configured'))
->setSummary($summary)
->setMessage($message)
->addPHPConfig('date.timezone')
->addPhabricatorConfig('phabricator.timezone');
}
}