Cleanup some docs (includes/[s-z])
[lhc/web/wiklou.git] / includes / Setup.php
index 783ef3f..d551e76 100644 (file)
@@ -78,6 +78,14 @@ if ( $wgExtensionAssetsPath === false ) {
        $wgExtensionAssetsPath = "$wgScriptPath/extensions";
 }
 
+// Enable default skins. Temporary, to be removed before 1.24 release.
+// This is hacky and bad, the require_once calls should eventually be generated by the installer
+// and placed in LocalSettings.php.
+// While this is in Setup.php, it needs to be done as soon as possible, as some of the setup code
+// depends on all extensions and skins being already required (bug 67318).
+require_once "$wgStyleDirectory/MonoBook/MonoBook.php";
+require_once "$wgStyleDirectory/Vector/Vector.php";
+
 if ( $wgLogo === false ) {
        $wgLogo = "$wgStylePath/common/images/wiki.png";
 }
@@ -98,15 +106,15 @@ if ( $wgDeletedDirectory === false ) {
        $wgDeletedDirectory = "{$wgUploadDirectory}/deleted";
 }
 
-if ( isset( $wgFileStore['deleted']['directory'] ) ) {
-       $wgDeletedDirectory = $wgFileStore['deleted']['directory'];
+if ( $wgGitInfoCacheDirectory === false && $wgCacheDirectory !== false ) {
+       $wgGitInfoCacheDirectory = "{$wgCacheDirectory}/gitinfo";
 }
 
 if ( isset( $wgFooterIcons['copyright'] )
        && isset( $wgFooterIcons['copyright']['copyright'] )
        && $wgFooterIcons['copyright']['copyright'] === array()
 ) {
-       if ( isset( $wgCopyrightIcon ) && $wgCopyrightIcon ) {
+       if ( $wgCopyrightIcon ) {
                $wgFooterIcons['copyright']['copyright'] = $wgCopyrightIcon;
        } elseif ( $wgRightsIcon || $wgRightsText ) {
                $wgFooterIcons['copyright']['copyright'] = array(
@@ -161,11 +169,7 @@ $wgLockManagers[] = array(
  * Initialise $wgLocalFileRepo from backwards-compatible settings
  */
 if ( !$wgLocalFileRepo ) {
-       if ( isset( $wgFileStore['deleted']['hash'] ) ) {
-               $deletedHashLevel = $wgFileStore['deleted']['hash'];
-       } else {
-               $deletedHashLevel = $wgHashedUploadDirectory ? 3 : 0;
-       }
+       $deletedHashLevel = $wgHashedUploadDirectory ? 3 : 0;
        $wgLocalFileRepo = array(
                'class' => 'LocalRepo',
                'name' => 'local',
@@ -366,10 +370,6 @@ if ( !$wgHtml5Version && $wgAllowRdfaAttributes ) {
 // Blacklisted file extensions shouldn't appear on the "allowed" list
 $wgFileExtensions = array_values( array_diff ( $wgFileExtensions, $wgFileBlacklist ) );
 
-if ( $wgArticleCountMethod === null ) {
-       $wgArticleCountMethod = $wgUseCommaCount ? 'comma' : 'link';
-}
-
 if ( $wgInvalidateCacheOnLocalSettingsChange ) {
        // @codingStandardsIgnoreStart Generic.PHP.NoSilencedErrors.Discouraged - No GlobalFunction here yet.
        $wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', @filemtime( "$IP/LocalSettings.php" ) ) );
@@ -488,7 +488,7 @@ if ( !$wgHTCPRouting && $wgHTCPMulticastAddress ) {
 }
 
 // Back compatibility for $wgRateLimitLog deprecated with 1.23
-if ( $wgRateLimitLog && ! array_key_exists( 'ratelimit', $wgDebugLogGroups ) ) {
+if ( $wgRateLimitLog && !array_key_exists( 'ratelimit', $wgDebugLogGroups ) ) {
        $wgDebugLogGroups['ratelimit'] = $wgRateLimitLog;
 }
 
@@ -573,26 +573,33 @@ if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode &&
 wfProfileOut( $fname . '-session' );
 wfProfileIn( $fname . '-globals' );
 
+/**
+ * @var Language $wgContLang
+ */
 $wgContLang = Language::factory( $wgLanguageCode );
 $wgContLang->initEncoding();
 $wgContLang->initContLang();
 
 // Now that variant lists may be available...
 $wgRequest->interpolateTitle();
+
+/**
+ * @var User $wgUser
+ */
 $wgUser = RequestContext::getMain()->getUser(); // BackCompat
 
 /**
- * @var $wgLang Language
+ * @var Language $wgLang
  */
 $wgLang = new StubUserLang;
 
 /**
- * @var OutputPage
+ * @var OutputPage $wgOut
  */
 $wgOut = RequestContext::getMain()->getOutput(); // BackCompat
 
 /**
- * @var $wgParser Parser
+ * @var Parser $wgParser
  */
 $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) );
 
@@ -601,16 +608,32 @@ if ( !is_object( $wgAuth ) ) {
        wfRunHooks( 'AuthPluginSetup', array( &$wgAuth ) );
 }
 
-# Placeholders in case of DB error
+/**
+ * @var Title $wgTitle
+ */
 $wgTitle = null;
 
 $wgDeferredUpdateList = array();
 
-// Enable default skins.
-// This is hacky and bad, the require_once calls should eventually be generated by the installer
-// and placed in LocalSettings.php.
-require_once "$wgStyleDirectory/MonoBook/MonoBook.php";
-require_once "$wgStyleDirectory/Vector/Vector.php";
+// Disable all other email settings automatically if $wgEnableEmail
+// is set to false. - bug 63678
+if ( !$wgEnableEmail ) {
+       $wgAllowHTMLEmail = false;
+       $wgEmailAuthentication = false; // do not require auth if you're not sending email anyway
+       $wgEnableUserEmail = false;
+       $wgEnotifFromEditor = false;
+       $wgEnotifImpersonal = false;
+       $wgEnotifMaxRecips = 0;
+       $wgEnotifMinorEdits = false;
+       $wgEnotifRevealEditorAddress = false;
+       $wgEnotifUseJobQ = false;
+       $wgEnotifUseRealName = false;
+       $wgEnotifUserTalk = false;
+       $wgEnotifWatchlist = false;
+       unset( $wgGroupPermissions['user']['sendemail'] );
+       $wgUserEmailUseReplyTo = false;
+       $wgUsersNotifiedOnAllChanges = array();
+}
 
 wfProfileOut( $fname . '-globals' );
 wfProfileIn( $fname . '-extensions' );