From: jenkins-bot Date: Thu, 5 Sep 2019 17:57:13 +0000 (+0000) Subject: Merge "docs: Avoid Doxygen warnings for non-doc related tags" X-Git-Tag: 1.34.0-rc.0~379 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=0549bbc50bc551364aa278162ef542b37f61bbb9;hp=e25ce2a1eab1bb40c7b19ddd89efd02e1234e12e;p=lhc%2Fweb%2Fwiklou.git Merge "docs: Avoid Doxygen warnings for non-doc related tags" --- diff --git a/includes/Setup.php b/includes/Setup.php index d629021e6e..e55fbe88ca 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -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. diff --git a/includes/cache/HTMLFileCache.php b/includes/cache/HTMLFileCache.php index a0d61b259e..ab78ee469b 100644 --- a/includes/cache/HTMLFileCache.php +++ b/includes/cache/HTMLFileCache.php @@ -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; } diff --git a/includes/debug/MWDebug.php b/includes/debug/MWDebug.php index e8778362ec..6bcb0e6ff8 100644 --- a/includes/debug/MWDebug.php +++ b/includes/debug/MWDebug.php @@ -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. diff --git a/includes/libs/http/MultiHttpClient.php b/includes/libs/http/MultiHttpClient.php index 2e3aa70e4e..0f110598c6 100644 --- a/includes/libs/http/MultiHttpClient.php +++ b/includes/libs/http/MultiHttpClient.php @@ -358,10 +358,6 @@ class MultiHttpClient implements LoggerAwareInterface { ); } elseif ( $req['method'] === 'POST' ) { curl_setopt( $ch, CURLOPT_POST, 1 ); - // Don't interpret POST parameters starting with '@' as file uploads, because this - // makes it impossible to POST plain values starting with '@' (and causes security - // issues potentially exposing the contents of local files). - curl_setopt( $ch, CURLOPT_SAFE_UPLOAD, true ); curl_setopt( $ch, CURLOPT_POSTFIELDS, $req['body'] ); } else { if ( is_resource( $req['body'] ) || $req['body'] !== '' ) { diff --git a/includes/page/Article.php b/includes/page/Article.php index 0149171312..1c2e782b6b 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -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" ); diff --git a/maintenance/rebuildFileCache.php b/maintenance/rebuildFileCache.php index 2cdf418b25..d484392d7e 100644 --- a/maintenance/rebuildFileCache.php +++ b/maintenance/rebuildFileCache.php @@ -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(); } diff --git a/tests/phpunit/MediaWikiIntegrationTestCase.php b/tests/phpunit/MediaWikiIntegrationTestCase.php index 41c65b28ed..b738312725 100644 --- a/tests/phpunit/MediaWikiIntegrationTestCase.php +++ b/tests/phpunit/MediaWikiIntegrationTestCase.php @@ -1830,6 +1830,7 @@ abstract class MediaWikiIntegrationTestCase extends PHPUnit\Framework\TestCase { $pageTables = [ 'page', 'revision', 'ip_changes', 'revision_comment_temp', 'comment', 'archive', 'revision_actor_temp', 'slots', 'content', 'content_models', 'slot_roles', + 'change_tag', ]; $coreDBDataTables = array_merge( $userTables, $pageTables );