Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -3209,13 +3209,12 @@ |
3210 | 3210 | ini_set( "memory_limit", $conflimit ); |
3211 | 3211 | wfRestoreWarnings(); |
3212 | 3212 | 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" ); |
3216 | 3215 | wfSuppressWarnings(); |
3217 | | - ini_set( "memory_limit", $max ); |
| 3216 | + ini_set( "memory_limit", $conflimit ); |
3218 | 3217 | wfRestoreWarnings(); |
3219 | | - return $max; |
| 3218 | + return $conflimit; |
3220 | 3219 | } |
3221 | 3220 | } |
3222 | 3221 | return $memlimit; |
Index: trunk/phase3/config/index.php |
— | — | @@ -466,16 +466,16 @@ |
467 | 467 | Perl-compatible regular expression functions." ); |
468 | 468 | |
469 | 469 | $memlimit = ini_get( "memory_limit" ); |
470 | | -$newlimit = wfMemoryLimit(); |
471 | | -global $wgMemoryLimit; |
472 | 470 | if( $memlimit == -1 ) { |
473 | 471 | print "<li>PHP is configured with no <tt>memory_limit</tt>.</li>\n"; |
474 | 472 | } else { |
475 | 473 | 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 ) { |
479 | 477 | print "<b>Failed raising limit, installation may fail.</b>"; |
| 478 | + } elseif ( $newlimit > $memlimit ) { |
| 479 | + print "Raised <tt>memory_limit</tt> to " . htmlspecialchars( $newlimit ) . " bytes. "; |
480 | 480 | } |
481 | 481 | print "</li>\n"; |
482 | 482 | } |