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