Followup to r54416
authorOverlordQ <overlordq@users.mediawiki.org>
Wed, 5 Aug 2009 02:34:41 +0000 (02:34 +0000)
committerOverlordQ <overlordq@users.mediawiki.org>
Wed, 5 Aug 2009 02:34:41 +0000 (02:34 +0000)
Dont log messages when you 'increase' the limit from a number to itself.

config/index.php
includes/GlobalFunctions.php

index 4f6cd28..0722588 100644 (file)
@@ -466,16 +466,16 @@ if( !function_exists( 'preg_match' ) )
        Perl-compatible regular expression functions." );
 
 $memlimit = ini_get( "memory_limit" );
-$newlimit = wfMemoryLimit();
-global $wgMemoryLimit;
 if( $memlimit == -1 ) {
        print "<li>PHP is configured with no <tt>memory_limit</tt>.</li>\n";
 } else {
        print "<li>PHP's <tt>memory_limit</tt> is " . htmlspecialchars( $memlimit ). " bytes. ";
-       if( $newlimit >= $wgMemoryLimit ) {
-               print "Successfully set limit to " . htmlspecialchars( $newlimit ) . "... ";
-       } else {
+       $newlimit = wfMemoryLimit();
+       $memlimit = wfShorthandToInteger( $memlimit );
+       if( $newlimit < $memlimit ) {
                print "<b>Failed raising limit, installation may fail.</b>";
+       } elseif ( $newlimit > $memlimit )  {
+               print "Raised <tt>memory_limit</tt> to " . htmlspecialchars( $newlimit ) . " bytes. ";
        }
        print "</li>\n";
 }
index 77daed3..b66589a 100644 (file)
@@ -3209,13 +3209,12 @@ function wfMemoryLimit () {
                        ini_set( "memory_limit", $conflimit );
                        wfRestoreWarnings();
                        return $conflimit;
-               } else {
-                       $max = max( $memlimit, $conflimit );
-                       wfDebug( "Raising PHP's memory limit to $max bytes\n" );
+               } elseif ( $conflimit > $memlimit ) {
+                       wfDebug( "Raising PHP's memory limit to $conflimit bytes\n" );
                        wfSuppressWarnings();
-                       ini_set( "memory_limit", $max );
+                       ini_set( "memory_limit", $conflimit );
                        wfRestoreWarnings();
-                       return $max;
+                       return $conflimit;
                }
        }
        return $memlimit;