X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FSetup.php;h=0c1e99df8dc93bbc5b4f6c8a51e91ec1490b8ebc;hb=be79b120919138df2f4e701ed65f202d87fcbd86;hp=1324ed8bbeccf5f0ce5c5bae21cac60f3b12c33e;hpb=7f1df682b62457e267831ec6527ca4728723caef;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Setup.php b/includes/Setup.php index 1324ed8bbe..0c1e99df8d 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -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, @@ -361,13 +363,13 @@ if ( $wgMetaNamespace === false ) { // Default value is 2000 or the suhosin limit if it is between 1 and 2000 if ( $wgResourceLoaderMaxQueryLength === false ) { - $suhosinMaxValueLength = (int) ini_get( 'suhosin.get.max_value_length' ); + $suhosinMaxValueLength = (int)ini_get( 'suhosin.get.max_value_length' ); if ( $suhosinMaxValueLength > 0 && $suhosinMaxValueLength < 2000 ) { $wgResourceLoaderMaxQueryLength = $suhosinMaxValueLength; } else { $wgResourceLoaderMaxQueryLength = 2000; } - unset($suhosinMaxValueLength); + unset( $suhosinMaxValueLength ); } /** @@ -427,12 +429,12 @@ if ( !$wgHtml5Version && $wgAllowRdfaAttributes ) { } // Blacklisted file extensions shouldn't appear on the "allowed" list -$wgFileExtensions = array_values( array_diff ( $wgFileExtensions, $wgFileBlacklist ) ); +$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 @@ -481,7 +492,7 @@ if ( !class_exists( 'AutoLoader' ) ) { MWExceptionHandler::installHandler(); -require_once "$IP/includes/libs/normal/UtfNormalUtil.php"; +require_once "$IP/includes/compat/normal/UtfNormalUtil.php"; $ps_default2 = Profiler::instance()->scopedProfileIn( $fname . '-defaults2' ); @@ -525,7 +536,9 @@ if ( $wgTmpDirectory === false ) { // We don't use counters anymore. Left here for extensions still // expecting this to exist. Should be removed sometime 1.26 or later. -$wgDisableCounters = true; +if ( !isset( $wgDisableCounters ) ) { + $wgDisableCounters = true; +} if ( $wgMainWANCache === false ) { // Setup a WAN cache from $wgMainCacheType with no relayer. @@ -552,9 +565,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 );