1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-01 03:02:43 +01:00
phorge-phorge/src/applications/config/check/PhabricatorSetupCheckTimezone.php
Joshua Spence 0a62f13464 Change double quotes to single quotes.
Summary: Ran `arc lint --apply-patches --everything` over rP, mainly to change double quotes to single quotes where appropriate. These changes also validate that the `ArcanistXHPASTLinter::LINT_DOUBLE_QUOTE` rule is working as expected.

Test Plan: Eyeballed it.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin, hach-que

Differential Revision: https://secure.phabricator.com/D9431
2014-06-09 11:36:50 -07:00

51 lines
1.6 KiB
PHP

<?php
final class PhabricatorSetupCheckTimezone extends PhabricatorSetupCheck {
protected function executeChecks() {
$php_value = ini_get('date.timezone');
if ($php_value) {
$old = date_default_timezone_get();
$ok = @date_default_timezone_set($php_value);
date_default_timezone_set($old);
if (!$ok) {
$message = pht(
'Your PHP configuration configuration selects an invalid timezone. '.
'Select a valid timezone.');
$this
->newIssue('php.date.timezone')
->setShortName(pht('PHP Timezone'))
->setName(pht('PHP Timezone Invalid'))
->setMessage($message)
->addPHPConfig('date.timezone');
}
}
$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');
}
}