From 9e3b81e3218c3eb59885b17bca29ea235e24b96e Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Thu, 16 Oct 2008 11:32:44 +0000 Subject: [PATCH] Use a variable for max shell time, don't use php.ini, like we do for memory and file size. --- RELEASE-NOTES | 2 ++ includes/DefaultSettings.php | 5 +++++ includes/GlobalFunctions.php | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index aac9a2c0dd..a146a4613b 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -166,6 +166,8 @@ The following extensions are migrated into MediaWiki 1.14: * Added a call to the 'UnwatchArticleComplete' hook to the watchlist editor. This should make it so that ALL user-accessible methods of removing a page from a watchlist lead to this hook being called (it was previously only called from within Article.php +* Maximum execution time for shell processes on linux is now configured with + $wgMaxShellTime (180 seconds by default) === Bug fixes in 1.14 === diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 209a3ee7c3..6fc717a51a 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -3256,6 +3256,11 @@ $wgMaxShellMemory = 102400; */ $wgMaxShellFileSize = 102400; +/** + * Maximum CPU time in seconds for shell processes under linux + */ +$wgMaxShellTime = 180; + /** * Executable name of PHP cli client (php/php5) */ diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index b03b06ba99..ece0471d03 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2145,7 +2145,7 @@ function wfIniGetBool( $setting ) { * @return collected stdout as a string (trailing newlines stripped) */ function wfShellExec( $cmd, &$retval=null ) { - global $IP, $wgMaxShellMemory, $wgMaxShellFileSize; + global $IP, $wgMaxShellMemory, $wgMaxShellFileSize, $wgMaxShellTime; if( wfIniGetBool( 'safe_mode' ) ) { wfDebug( "wfShellExec can't run in safe_mode, PHP's exec functions are too broken.\n" ); @@ -2155,7 +2155,7 @@ function wfShellExec( $cmd, &$retval=null ) { wfInitShellLocale(); if ( php_uname( 's' ) == 'Linux' ) { - $time = intval( ini_get( 'max_execution_time' ) ); + $time = intval( $wgMaxShellTime ); $mem = intval( $wgMaxShellMemory ); $filesize = intval( $wgMaxShellFileSize ); -- 2.20.1