better detection of timezone during install

(suppress PHP warnings if timezone is not set in php.ini)
This commit is contained in:
Martin Konecny 2012-09-17 15:55:46 -04:00
parent 54bb414500
commit 1483fb92e5
1 changed files with 2 additions and 1 deletions

View File

@ -320,7 +320,8 @@ class AirtimeInstall
{
$con = Propel::getConnection();
// we need to run php as commandline because we want to get the timezone in cli php.ini file
$defaultTimezone = exec("php -r 'echo date_default_timezone_get().PHP_EOL;'");
//$defaultTimezone = exec("php -r 'echo date_default_timezone_get().PHP_EOL;'");
$defaultTimezone = exec("cat /etc/timezone");
$defaultTimezone = trim($defaultTimezone);
if((!in_array($defaultTimezone, DateTimeZone::listIdentifiers()))){
$defaultTimezone = "UTC";