From: Tim Starling Date: Sat, 26 Nov 2005 02:57:18 +0000 (+0000) Subject: wfShellExec fix, debug log tweak X-Git-Tag: 1.6.0~1130 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=d8404c7bd7a63bee9019457ebd6b6b4d9e45e04e;p=lhc%2Fweb%2Fwiklou.git wfShellExec fix, debug log tweak --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 5666072054..b4be6488ae 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -201,7 +201,8 @@ function wfDebugLog( $logGroup, $text, $public = true ) { function wfLogDBError( $text ) { global $wgDBerrorLog; if ( $wgDBerrorLog ) { - $text = date('D M j G:i:s T Y') . "\t".$text; + $host = trim(`hostname`); + $text = date('D M j G:i:s T Y') . "\t$host\t".$text; error_log( $text, 3, $wgDBerrorLog ); } } @@ -1585,8 +1586,11 @@ function wfShellExec( $cmd ) global $IP; if ( php_uname( 's' ) == 'Linux' ) { $time = ini_get( 'max_execution_time' ); - $memKB = intval( ini_get( 'memory_limit' ) / 1024 ); - $cmd = escapeshellarg( "$IP/ulimit.sh" ) . " $time $memKB $cmd"; + $mem = ini_get( 'memory_limit' ); + if ( $time > 0 && $mem > 0 ) { + $memKB = intval( $mem / 1024 ); + $cmd = escapeshellarg( "$IP/bin/ulimit.sh" ) . " $time $memKB $cmd"; + } } return shell_exec( $cmd ); }