Use a variable for max shell time, don't use php.ini, like we do for memory and file...
authorTim Starling <tstarling@users.mediawiki.org>
Thu, 16 Oct 2008 11:32:44 +0000 (11:32 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Thu, 16 Oct 2008 11:32:44 +0000 (11:32 +0000)
RELEASE-NOTES
includes/DefaultSettings.php
includes/GlobalFunctions.php

index aac9a2c..a146a46 100644 (file)
@@ -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 ===
 
index 209a3ee..6fc717a 100644 (file)
@@ -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)
 */
index b03b06b..ece0471 100644 (file)
@@ -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 );