diff --git a/core/Core.php b/core/Core.php index 6dcefca71..b9dd3d95b 100755 --- a/core/Core.php +++ b/core/Core.php @@ -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 */ diff --git a/main.php b/main.php index e6d9b9d80..a493e4551 100644 --- a/main.php +++ b/main.php @@ -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.