From d8404c7bd7a63bee9019457ebd6b6b4d9e45e04e Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 26 Nov 2005 02:57:18 +0000 Subject: [PATCH] wfShellExec fix, debug log tweak --- includes/GlobalFunctions.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 ); } -- 2.20.1