Merge "resourceloader: Use -1 instead of null in DerivativeResourceLoaderContext"
[lhc/web/wiklou.git] / includes / Setup.php
index 1324ed8..8462f68 100644 (file)
@@ -105,6 +105,10 @@ if ( $wgGitInfoCacheDirectory === false && $wgCacheDirectory !== false ) {
        $wgGitInfoCacheDirectory = "{$wgCacheDirectory}/gitinfo";
 }
 
+if ( $wgEnableParserCache === false ) {
+       $wgParserCacheType = CACHE_NONE;
+}
+
 // Fix path to icon images after they were moved in 1.24
 if ( $wgRightsIcon ) {
        $wgRightsIcon = str_replace(
@@ -232,9 +236,7 @@ if ( $wgUseInstantCommons ) {
        $wgForeignFileRepos[] = array(
                'class' => 'ForeignAPIRepo',
                'name' => 'wikimediacommons',
-               'apibase' => WebRequest::detectProtocol() === 'https' ?
-                       'https://commons.wikimedia.org/w/api.php' :
-                       'http://commons.wikimedia.org/w/api.php',
+               'apibase' => 'https://commons.wikimedia.org/w/api.php',
                'hashLevels' => 2,
                'fetchDescription' => true,
                'descriptionCacheExpiry' => 43200,
@@ -430,9 +432,9 @@ if ( !$wgHtml5Version && $wgAllowRdfaAttributes ) {
 $wgFileExtensions = array_values( array_diff ( $wgFileExtensions, $wgFileBlacklist ) );
 
 if ( $wgInvalidateCacheOnLocalSettingsChange ) {
-       // @codingStandardsIgnoreStart Generic.PHP.NoSilencedErrors.Discouraged - No GlobalFunction here yet.
-       $wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', @filemtime( "$IP/LocalSettings.php" ) ) );
-       // @codingStandardsIgnoreEnd
+       MediaWiki\suppressWarnings();
+       $wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', filemtime( "$IP/LocalSettings.php" ) ) );
+       MediaWiki\restoreWarnings();
 }
 
 if ( $wgNewUserLog ) {
@@ -466,6 +468,15 @@ if ( $wgProfileOnly ) {
        $wgDebugLogFile = '';
 }
 
+// Backwards compatibility with old password limits
+if ( $wgMinimalPasswordLength !== false ) {
+       $wgPasswordPolicy['policies']['default']['MinimalPasswordLength'] = $wgMinimalPasswordLength;
+}
+
+if ( $wgMaximalPasswordLength !== false ) {
+       $wgPasswordPolicy['policies']['default']['MaximalPasswordLength'] = $wgMaximalPasswordLength;
+}
+
 Profiler::instance()->scopedProfileOut( $ps_default );
 
 // Disable MWDebug for command line mode, this prevents MWDebug from eating up
@@ -552,9 +563,9 @@ wfMemoryLimit();
  * explicitly set. Inspired by phpMyAdmin's treatment of the problem.
  */
 if ( is_null( $wgLocaltimezone ) ) {
-       wfSuppressWarnings();
+       MediaWiki\suppressWarnings();
        $wgLocaltimezone = date_default_timezone_get();
-       wfRestoreWarnings();
+       MediaWiki\restoreWarnings();
 }
 
 date_default_timezone_set( $wgLocaltimezone );