* (bug 19907) $wgCrossSiteAJAXdomains and $wgCrossSiteAJAXdomainsRegex added
to control which external domains may access the API via cross-site AJAX.
* $wgMaintenanceScripts for extensions to add their scripts to the default list
+* $wgMemoryLimit has been added, default value '50M'
=== New features in 1.16 ===
style that specifies the media attribute as screen. This is done to resolve
and issue with Opera (bug 18497) where fullscreen mode is assumed to be
projection mode and the style sheet for screen media is no longer used.
+* (bug 16084) Default memory limit has be increased to 50M, see $wgMemoryLimit
== API changes in 1.16 ==
Perl-compatible regular expression functions." );
$memlimit = ini_get( "memory_limit" );
-$conf->raiseMemory = false;
if( empty( $memlimit ) || $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 ) . ". ";
- $n = intval( $memlimit );
- if( preg_match( '/^([0-9]+)[Mm]$/', trim( $memlimit ), $m ) ) {
- $n = intval( $m[1] * (1024*1024) );
- }
- if( $n < 20*1024*1024 ) {
- print "Attempting to raise limit to 20M... ";
- if( false === ini_set( "memory_limit", "20M" ) ) {
+ global $wgMemoryLimit;
+ if( wfParseMemoryLimit( $memlimit ) < wfParseMemoryLimit( $wgMemoryLimit ) ) {
+ print "Attempting to raise limit to " . htmlspecialchars( $wgMemoryLimit ) . "... ";
+ if( false === ini_set( "memory_limit", $wgMemoryLimit ) ) {
print "failed.<br /><b>" . htmlspecialchars( $memlimit ) . " seems too low, installation may fail!</b>";
} else {
- $conf->raiseMemory = true;
print "ok.";
}
}
require_once( \"\$IP/includes/DefaultSettings.php\" );
-# If PHP's memory limit is very low, some operations may fail.
-" . ($conf->raiseMemory ? '' : '# ' ) . "ini_set( 'memory_limit', '20M' );" . "
-
if ( \$wgCommandLineMode ) {
if ( isset( \$_SERVER ) && array_key_exists( 'REQUEST_METHOD', \$_SERVER ) ) {
die( \"This script must be run from the command line\\n\" );
*/
$wgCrossSiteAJAXdomainsRegex = false;
+/**
+ * The minimum amount of memory that MediaWiki "needs"; MediaWiki will try to raise PHP's memory limit if it's below this amount.
+ */
+$wgMemoryLimit = "50M";
+
return $array;
}
+/* Parse PHP's silly format for memory limits */
+function wfParseMemoryLimit( $memlimit ) {
+ $n = intval( $memlimit );
+ if( preg_match( '/^([0-9]+)[Mm]$/', trim( $memlimit ), $m ) ) {
+ $n = intval( $m[1] * (1024*1024) );
+ }
+ return $n;
+}
+
/* Get the normalised IETF language tag
* @param $code String: The language code.
* @return $langCode String: The language code which complying with BCP 47 standards.
require_once( "$IP/includes/StubObject.php" );
wfProfileOut( $fname.'-includes' );
wfProfileIn( $fname.'-misc1' );
-
+# Raise the memory limit if it's too low
+global $wgMemoryLimit;
+$memlimit = ini_get( "memory_limit" );
+if( !( empty( $memlimit ) || $memlimit == -1 ) ) {
+ if( wfParseMemoryLimit( $memlimit ) < wfParseMemoryLimit( $wgMemoryLimit ) ) {
+ wfDebug( "\n\nRaise PHP's memory limit from $memlimit to $wgMemoryLimit\n" );
+ ini_set( "memory_limit", $wgMemoryLimit );
+ }
+}
$wgIP = false; # Load on demand
# Can't stub this one, it sets up $_GET and $_REQUEST in its constructor