BUG FIX: The 5.1 replacement array_fill_keys function now made available to the cron jobs (from r97300)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102441 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-12 05:00:40 +00:00
parent b69b03b9e0
commit 40466ccb02
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.