summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorJack Webb-Heller <jack@jackwebbheller.com>2011-12-01 12:56:12 +0100
committerJack Webb-Heller <jack@jackwebbheller.com>2011-12-01 12:56:12 +0100
commit796b2b711f22775ef8e2a578bd71d065f9800442 (patch)
tree85b3669cc745777e5c7dd2f6bc7c4d77d367d63f /system
parentff30be1c782a853b8c58f520214ac5079f273c42 (diff)
CodeIgniter ignores the set config value for Maximum Execution Time, overwriting it with its own value of 300 seconds. Whilst this is sensible in the vast majority of situations (browsers), when running a script from CLI, it is likely that execution times may need to be longer. Therefore, don't override the time limit if being run from the CLI - instead default back to PHP's own configuration.
Diffstat (limited to 'system')
-rwxr-xr-xsystem/core/CodeIgniter.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php
index 4d76a5587..abdbf91d8 100755
--- a/system/core/CodeIgniter.php
+++ b/system/core/CodeIgniter.php
@@ -106,9 +106,13 @@
* Set a liberal script execution time limit
* ------------------------------------------------------
*/
- if (function_exists("set_time_limit") == TRUE AND @ini_get("safe_mode") == 0)
+ if (function_exists("set_time_limit") AND @ini_get("safe_mode") == 0)
{
- @set_time_limit(300);
+ // Do not override the Time Limit value if running from Command Line
+ if(php_sapi_name() != 'cli' && ! empty($_SERVER['REMOTE_ADDR']))
+ {
+ @set_time_limit(300);
+ }
}
/*