r54420 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54419‎ | r54420 | r54421 >
Date:02:34, 5 August 2009
Author:overlordq
Status:ok
Tags:
Comment:
Followup to r54416
Dont log messages when you 'increase' the limit from a number to itself.
Modified paths:
  • /trunk/phase3/config/index.php (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -3209,13 +3209,12 @@
32103210 ini_set( "memory_limit", $conflimit );
32113211 wfRestoreWarnings();
32123212 return $conflimit;
3213 - } else {
3214 - $max = max( $memlimit, $conflimit );
3215 - wfDebug( "Raising PHP's memory limit to $max bytes\n" );
 3213+ } elseif ( $conflimit > $memlimit ) {
 3214+ wfDebug( "Raising PHP's memory limit to $conflimit bytes\n" );
32163215 wfSuppressWarnings();
3217 - ini_set( "memory_limit", $max );
 3216+ ini_set( "memory_limit", $conflimit );
32183217 wfRestoreWarnings();
3219 - return $max;
 3218+ return $conflimit;
32203219 }
32213220 }
32223221 return $memlimit;
Index: trunk/phase3/config/index.php
@@ -466,16 +466,16 @@
467467 Perl-compatible regular expression functions." );
468468
469469 $memlimit = ini_get( "memory_limit" );
470 -$newlimit = wfMemoryLimit();
471 -global $wgMemoryLimit;
472470 if( $memlimit == -1 ) {
473471 print "<li>PHP is configured with no <tt>memory_limit</tt>.</li>\n";
474472 } else {
475473 print "<li>PHP's <tt>memory_limit</tt> is " . htmlspecialchars( $memlimit ). " bytes. ";
476 - if( $newlimit >= $wgMemoryLimit ) {
477 - print "Successfully set limit to " . htmlspecialchars( $newlimit ) . "... ";
478 - } else {
 474+ $newlimit = wfMemoryLimit();
 475+ $memlimit = wfShorthandToInteger( $memlimit );
 476+ if( $newlimit < $memlimit ) {
479477 print "<b>Failed raising limit, installation may fail.</b>";
 478+ } elseif ( $newlimit > $memlimit ) {
 479+ print "Raised <tt>memory_limit</tt> to " . htmlspecialchars( $newlimit ) . " bytes. ";
480480 }
481481 print "</li>\n";
482482 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r54416Follow up to r54414 and r54356. Hopefully catches all of the edge cases of er...overlordq01:33, 5 August 2009

Status & tagging log