Skip to content

Commit

Permalink
ENHANCEMENT PHP requirements in installer now check for date.timezone…
Browse files Browse the repository at this point in the history
… correctly being set for PHP 5.3.0+. This option is *required* to be set starting with 5.3.0 and will cause an error during installation if not (from r114467)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/trunk@114495 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
sminnee committed Dec 5, 2010
1 parent 4868877 commit 3f55474
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions install.php
Expand Up @@ -391,7 +391,11 @@ function check() {

// Check for hash support
$this->requireFunction('hash', array('PHP Configuration', 'hash support', 'hash support not included in PHP.'));


if(version_compare(PHP_VERSION, '5.3.0', '>=')) {
$this->requireDateTimezone(array('PHP Configuration', 'date.timezone set and valid', 'date.timezone option in php.ini must be set in PHP 5.3.0+', ini_get('date.timezone')));
}

// Check memory allocation
$this->requireMemory(32*1024*1024, 64*1024*1024, array("PHP Configuration", "Memory allocated (PHP config option 'memory_limit')", "SilverStripe needs a minimum of 32M allocated to PHP, but recommends 64M.", ini_get("memory_limit")));

Expand All @@ -407,7 +411,15 @@ function suggestPHPSetting($settingName, $settingValues, $testDetails) {
$this->warning($testDetails);
}
}


function requireDateTimezone($testDetails) {
$this->testing($testDetails);
$result = ini_get('date.timezone') && in_array(ini_get('date.timezone'), timezone_identifiers_list());
if(!$result) {
$this->error($testDetails);
}
}

function requireMemory($min, $recommended, $testDetails) {
$_SESSION['forcemem'] = false;

Expand Down

0 comments on commit 3f55474

Please sign in to comment.