Merge "Disable Preferences save button before setting change"
[lhc/web/wiklou.git] / includes / Setup.php
index 7a33328..70c935d 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(
@@ -430,9 +434,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 +470,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
@@ -485,8 +498,8 @@ require_once "$IP/includes/libs/normal/UtfNormalUtil.php";
 
 $ps_default2 = Profiler::instance()->scopedProfileIn( $fname . '-defaults2' );
 
-if ( defined( 'MW_ENTRY_PHP5' ) ) {
-       wfWarn( 'The ".php5" entry point files are deprecated. Use ".php" instead.' );
+if ( $wgScriptExtension !== '.php' || defined( 'MW_ENTRY_PHP5' ) ) {
+       wfWarn( 'Script extensions other than ".php" are deprecated.' );
 }
 
 if ( $wgCanonicalServer === false ) {
@@ -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 );