Merge "Make wfForeignMemcKey consistent with wfMemcKey"
[lhc/web/wiklou.git] / includes / Setup.php
index 1ceee49..4f5ac92 100644 (file)
@@ -293,6 +293,13 @@ if ( $wgMetaNamespace === false ) {
        $wgMetaNamespace = str_replace( ' ', '_', $wgSitename );
 }
 
+
+// Default value is either the suhosin limit or -1 for unlimited
+if ( $wgResourceLoaderMaxQueryLength === false ) {
+       $maxValueLength = ini_get( 'suhosin.get.max_value_length' );
+       $wgResourceLoaderMaxQueryLength = $maxValueLength > 0 ? $maxValueLength : -1;
+}
+
 /**
  * Definitions of the NS_ constants are in Defines.php
  * @private
@@ -344,7 +351,13 @@ foreach ( $wgDisabledActions as $action ) {
        $wgActions[$action] = false;
 }
 
-if ( !$wgHtml5Version && $wgHtml5 && $wgAllowRdfaAttributes ) {
+# We always output HTML5 since 1.22, overriding these is no longer supported
+# we set them here for extensions that depend on its value.
+$wgHtml5 = true;
+$wgXhtmlDefaultNamespace = 'http://www.w3.org/1999/xhtml';
+$wgJsMimeType = 'text/javascript';
+
+if ( !$wgHtml5Version && $wgAllowRdfaAttributes ) {
        # see http://www.w3.org/TR/rdfa-in-html/#document-conformance
        if ( $wgMimeType == 'application/xhtml+xml' ) {
                $wgHtml5Version = 'XHTML+RDFa 1.0';
@@ -391,22 +404,20 @@ if ( $wgDebugToolbar && !$wgCommandLineMode ) {
        MWDebug::init();
 }
 
-if ( !defined( 'MW_COMPILED' ) ) {
-       if ( !MWInit::classExists( 'AutoLoader' ) ) {
-               require_once( "$IP/includes/AutoLoader.php" );
-       }
+if ( !class_exists( 'AutoLoader' ) ) {
+       require_once "$IP/includes/AutoLoader.php";
+}
 
-       wfProfileIn( $fname . '-exception' );
-       MWExceptionHandler::installHandler();
-       wfProfileOut( $fname . '-exception' );
+wfProfileIn( $fname . '-exception' );
+MWExceptionHandler::installHandler();
+wfProfileOut( $fname . '-exception' );
 
-       wfProfileIn( $fname . '-includes' );
-       require_once( "$IP/includes/normal/UtfNormalUtil.php" );
-       require_once( "$IP/includes/GlobalFunctions.php" );
-       require_once( "$IP/includes/ProxyTools.php" );
-       require_once( "$IP/includes/normal/UtfNormalDefines.php" );
-       wfProfileOut( $fname . '-includes' );
-}
+wfProfileIn( $fname . '-includes' );
+require_once "$IP/includes/normal/UtfNormalUtil.php";
+require_once "$IP/includes/GlobalFunctions.php";
+require_once "$IP/includes/ProxyTools.php";
+require_once "$IP/includes/normal/UtfNormalDefines.php";
+wfProfileOut( $fname . '-includes' );
 
 if ( $wgSecureLogin && substr( $wgServer, 0, 2 ) !== '//' ) {
        $wgSecureLogin = false;
@@ -423,9 +434,16 @@ if ( $wgCanonicalServer === false ) {
        $wgCanonicalServer = wfExpandUrl( $wgServer, PROTO_HTTP );
 }
 
-// Initialize $wgHTCPMulticastRouting from backwards-compatible settings
-if ( !$wgHTCPMulticastRouting && $wgHTCPMulticastAddress ) {
-       $wgHTCPMulticastRouting = array(
+// $wgHTCPMulticastRouting got renamed to $wgHTCPRouting in MediaWiki 1.22
+// ensure back compatibility.
+if ( !$wgHTCPRouting && $wgHTCPMulticastRouting ) {
+       $wgHTCPRouting = $wgHTCPMulticastRouting;
+}
+
+// Initialize $wgHTCPRouting from backwards-compatible settings that
+// comes from pre 1.20 version.
+if ( !$wgHTCPRouting && $wgHTCPMulticastAddress ) {
+       $wgHTCPRouting = array(
                '' => array(
                        'host' => $wgHTCPMulticastAddress,
                        'port' => $wgHTCPPort,