BUG FIX: The 5.1 replacement array_fill_keys function now made available to the cron jobs

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@97300 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Geoff Munn 2010-01-21 00:36:04 +00:00 committed by Sam Minnee
parent f4de365be8
commit ed5c173366
2 changed files with 14 additions and 13 deletions

View File

@ -24,6 +24,20 @@
if(defined('E_DEPRECATED')) error_reporting(E_ALL ^ E_DEPRECATED);
else error_reporting(E_ALL);
/*
* This is for versions of PHP prior to version 5.2
* Creating this here will allow both web requests and cron jobs to inherit it.
*/
if (!function_exists('array_fill_keys')) {
function array_fill_keys($keys,$value) {
//Sometimes we get passed an empty array, and if that's the case, you'll get an error message
if(sizeof($keys)==0)
return Array();
else
return array_combine($keys,array_fill(0,count($keys),$value));
}
}
/**
* Include _ss_environment.php files
*/

View File

@ -65,19 +65,6 @@ if (function_exists('mb_http_output')) {
mb_internal_encoding('UTF-8');
}
/*
* This is for versions of PHP prior to version 5.2
*/
if (!function_exists('array_fill_keys')) {
function array_fill_keys($keys,$value) {
//Sometimes we get passed an empty array, and if that's the case, you'll get an error message
if(sizeof($keys)==0)
return Array();
else
return array_combine($keys,array_fill(0,count($keys),$value));
}
}
Session::start();
// IIS will sometimes generate this.