-function wfMemoryLimit() {
- global $wgMemoryLimit;
- $memlimit = wfShorthandToInteger( ini_get( 'memory_limit' ) );
- if ( $memlimit != -1 ) {
- $conflimit = wfShorthandToInteger( $wgMemoryLimit );
- if ( $conflimit == -1 ) {
+function wfMemoryLimit( $newLimit ) {
+ $oldLimit = wfShorthandToInteger( ini_get( 'memory_limit' ) );
+ // If the INI config is already unlimited, there is nothing larger
+ if ( $oldLimit != -1 ) {
+ $newLimit = wfShorthandToInteger( $newLimit );
+ if ( $newLimit == -1 ) {