Merge "Simplify some curl_setopt() calls in MultiHttpClient"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 5 Sep 2019 18:07:08 +0000 (18:07 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 5 Sep 2019 18:07:08 +0000 (18:07 +0000)
includes/Setup.php
includes/cache/HTMLFileCache.php
includes/debug/MWDebug.php
includes/libs/objectcache/wancache/WANObjectCache.php
includes/page/Article.php
includes/resourceloader/ResourceLoaderFileModule.php
maintenance/Doxyfile
maintenance/rebuildFileCache.php

index d629021..e55fbe8 100644 (file)
@@ -537,12 +537,6 @@ if ( isset( $wgSquidMaxage ) ) {
        $wgSquidMaxage = $wgCdnMaxAge;
 }
 
-// Easy to forget to falsify $wgDebugToolbar for static caches.
-// If file cache or CDN cache is on, just disable this (DWIMD).
-if ( $wgUseFileCache || $wgUseCdn ) {
-       $wgDebugToolbar = false;
-}
-
 // Blacklisted file extensions shouldn't appear on the "allowed" list
 $wgFileExtensions = array_values( array_diff( $wgFileExtensions, $wgFileBlacklist ) );
 
@@ -611,12 +605,7 @@ if ( defined( 'MW_NO_SESSION' ) ) {
        $wgPHPSessionHandling = MW_NO_SESSION === 'warn' ? 'warn' : 'disable';
 }
 
-// Disable MWDebug for command line mode, this prevents MWDebug from eating up
-// all the memory from logging SQL queries on maintenance scripts
-global $wgCommandLineMode;
-if ( $wgDebugToolbar && !$wgCommandLineMode ) {
-       MWDebug::init();
-}
+MWDebug::setup();
 
 // Reset the global service locator, so any services that have already been created will be
 // re-created while taking into account any custom settings and extensions.
index a0d61b2..ab78ee4 100644 (file)
@@ -94,10 +94,6 @@ class HTMLFileCache extends FileCacheBase {
                $config = MediaWikiServices::getInstance()->getMainConfig();
 
                if ( !$config->get( 'UseFileCache' ) && $mode !== self::MODE_REBUILD ) {
-                       return false;
-               } elseif ( $config->get( 'DebugToolbar' ) ) {
-                       wfDebug( "HTML file cache skipped. \$wgDebugToolbar on\n" );
-
                        return false;
                }
 
index e877836..6bcb0e6 100644 (file)
@@ -67,6 +67,30 @@ class MWDebug {
         */
        protected static $deprecationWarnings = [];
 
+       /**
+        * @internal For use by Setup.php only.
+        */
+       public static function setup() {
+               global $wgDebugToolbar,
+                       $wgUseCdn, $wgUseFileCache, $wgCommandLineMode;
+
+               if (
+                       // Easy to forget to falsify $wgDebugToolbar for static caches.
+                       // If file cache or CDN cache is on, just disable this (DWIMD).
+                       $wgUseCdn ||
+                       $wgUseFileCache ||
+                       // Keep MWDebug off on CLI. This prevents MWDebug from eating up
+                       // all the memory for logging SQL queries in maintenance scripts.
+                       $wgCommandLineMode
+               ) {
+                       return;
+               }
+
+               if ( $wgDebugToolbar ) {
+                       self::init();
+               }
+       }
+
        /**
         * Enabled the debugger and load resource module.
         * This is called by Setup.php when $wgDebugToolbar is true.
index a090e16..629d2cd 100644 (file)
@@ -125,7 +125,7 @@ class WANObjectCache implements IExpiringStore, IStoreKeyEncoder, LoggerAwareInt
        /** @var callable|null Function that takes a WAN cache callback and runs it later */
        protected $asyncHandler;
 
-       /** @bar bool Whether to use mcrouter key prefixing for routing */
+       /** @var bool Whether to use mcrouter key prefixing for routing */
        protected $mcrouterAware;
        /** @var string Physical region for mcrouter use */
        protected $region;
index 0149171..1c2e782 100644 (file)
@@ -587,7 +587,7 @@ class Article implements Page {
         * page of the given title.
         */
        public function view() {
-               global $wgUseFileCache, $wgDebugToolbar;
+               global $wgUseFileCache;
 
                # Get variables from query string
                # As side effect this will load the revision and update the title
@@ -643,7 +643,7 @@ class Article implements Page {
                }
 
                # Try client and file cache
-               if ( !$wgDebugToolbar && $oldid === 0 && $this->mPage->checkTouched() ) {
+               if ( $oldid === 0 && $this->mPage->checkTouched() ) {
                        # Try to stream the output from file cache
                        if ( $wgUseFileCache && $this->tryFileCache() ) {
                                wfDebug( __METHOD__ . ": done file cache\n" );
index d308d50..f2d0856 100644 (file)
@@ -798,9 +798,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
        /**
         * Get a list of file paths for all styles in this module, in order of proper inclusion.
         *
-        * This is considered a private method. Exposed for internal use by WebInstallerOutput.
-        *
-        * @private
+        * @internal Exposed only for use by WebInstallerOutput.
         * @param ResourceLoaderContext $context
         * @return array List of file paths
         */
index e5a8d98..dcd147f 100644 (file)
@@ -55,13 +55,17 @@ ALIASES                = "type{1}=<b> \1 </b>:" \
                          "protected=\access protected" \
                          "copyright=\note" \
                          "license=\note" \
+                         "inheritDoc=\inheritdoc" \
                          "codeCoverageIgnore=" \
+                         "codingStandardsIgnoreEnd=" \
                          "codingStandardsIgnoreStart=" \
-                         "group=" \
                          "covers=" \
                          "dataProvider=" \
                          "expectedException=" \
-                         "expectedExceptionMessage="
+                         "expectedExceptionMessage=" \
+                         "group=" \
+                         "phan=" \
+                         "suppress="
 TCL_SUBST              =
 OPTIMIZE_OUTPUT_FOR_C  = NO
 OPTIMIZE_OUTPUT_JAVA   = NO
index 2cdf418..d484392 100644 (file)
@@ -43,18 +43,18 @@ class RebuildFileCache extends Maintenance {
        }
 
        public function finalSetup() {
-               global $wgDebugToolbar, $wgUseFileCache;
+               global $wgUseFileCache;
 
                $this->enabled = $wgUseFileCache;
                // Script will handle capturing output and saving it itself
                $wgUseFileCache = false;
-               // Debug toolbar makes content uncacheable so we disable it.
-               // Has to be done before Setup.php initialize MWDebug
-               $wgDebugToolbar = false;
                //  Avoid DB writes (like enotif/counters)
                MediaWiki\MediaWikiServices::getInstance()->getReadOnlyMode()
                        ->setReason( 'Building cache' );
 
+               // Ensure no debug-specific logic ends up in the cache (must be after Setup.php)
+               MWDebug::deinit();
+
                parent::finalSetup();
        }