Merge "Removed doCascadeProtectionUpdates method to avoid DB writes on page views"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 23 Feb 2015 01:18:05 +0000 (01:18 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 23 Feb 2015 01:18:05 +0000 (01:18 +0000)
1  2 
includes/DefaultSettings.php
includes/page/Article.php
includes/parser/ParserOutput.php

@@@ -6422,6 -6422,7 +6422,7 @@@ $wgJobClasses = array
        'PublishStashedFile' => 'PublishStashedFileJob',
        'ThumbnailRender' => 'ThumbnailRenderJob',
        'recentChangesUpdate' => 'RecentChangesUpdateJob',
+       'refreshLinksPrioritized' => 'RefreshLinksJob', // for cascading protection
        'null' => 'NullJob'
  );
  
@@@ -6664,12 -6665,17 +6665,12 @@@ $wgLogHeaders = array
   * Extensions with custom log types may add to this array.
   */
  $wgLogActions = array(
 -      'block/block' => 'blocklogentry',
 -      'block/unblock' => 'unblocklogentry',
 -      'block/reblock' => 'reblock-logentry',
        'protect/protect' => 'protectedarticle',
        'protect/modify' => 'modifiedarticleprotection',
        'protect/unprotect' => 'unprotectedarticle',
        'protect/move_prot' => 'movedarticleprotection',
        'import/upload' => 'import-logentry-upload',
        'import/interwiki' => 'import-logentry-interwiki',
 -      'suppress/block' => 'blocklogentry',
 -      'suppress/reblock' => 'reblock-logentry',
  );
  
  /**
@@@ -6699,11 -6705,6 +6700,11 @@@ $wgLogActionsHandlers = array
        'managetags/delete' => 'LogFormatter',
        'managetags/activate' => 'LogFormatter',
        'managetags/deactivate' => 'LogFormatter',
 +      'block/block' => 'BlockLogFormatter',
 +      'block/unblock' => 'BlockLogFormatter',
 +      'block/reblock' => 'BlockLogFormatter',
 +      'suppress/block' => 'BlockLogFormatter',
 +      'suppress/reblock' => 'BlockLogFormatter',
  );
  
  /**
@@@ -707,7 -707,7 +707,7 @@@ class Article implements Page 
                }
  
                # Get the ParserOutput actually *displayed* here.
-               # Note that $this->mParserOutput is the *current* version output.
+               # Note that $this->mParserOutput is the *current*/oldid version output.
                $pOutput = ( $outputDone instanceof ParserOutput )
                        ? $outputDone // object fetched by hook
                        : $this->mParserOutput;
         */
        public function showRedirectedFromHeader() {
                global $wgRedirectSources;
 -              $outputPage = $this->getContext()->getOutput();
  
 -              $request = $this->getContext()->getRequest();
 +              $context = $this->getContext();
 +              $outputPage = $context->getOutput();
 +              $request = $context->getRequest();
                $rdfrom = $request->getVal( 'rdfrom' );
  
                // Construct a URL for the current page view, but with the target title
                                );
  
                                $outputPage->addSubtitle( "<span class=\"mw-redirectedfrom\">" .
 -                                      wfMessage( 'redirectedfrom' )->rawParams( $redir )->parse()
 +                                      $context->msg( 'redirectedfrom' )->rawParams( $redir )->parse()
                                . "</span>" );
  
                                // Add the script to update the displayed URL and
                        if ( $wgRedirectSources && preg_match( $wgRedirectSources, $rdfrom ) ) {
                                $redir = Linker::makeExternalLink( $rdfrom, $rdfrom );
                                $outputPage->addSubtitle( "<span class=\"mw-redirectedfrom\">" .
 -                                      wfMessage( 'redirectedfrom' )->rawParams( $redir )->parse()
 +                                      $context->msg( 'redirectedfrom' )->rawParams( $redir )->parse()
                                . "</span>" );
  
                                // Add the script to update the displayed URL
                }
                $html .= '</ul>';
  
 -              $redirectToText = wfMessage( 'redirectto' )->inLanguage( $lang )->text();
 +              $redirectToText = wfMessage( 'redirectto' )->inLanguage( $lang )->escaped();
  
                return '<div class="redirectMsg">' .
                        '<p>' . $redirectToText . '</p>' .
@@@ -684,7 -684,7 +684,7 @@@ class ParserOutput extends CacheTime 
         *
         * @note: custom DataUpdates do not survive serialization of the ParserOutput!
         * This is especially relevant when using a cached ParserOutput for updating
 -       * the database, as WikiPage does if $wgAjaxStashEdit is enabled. For this
 +       * the database, as WikiPage does if $wgAjaxEditStash is enabled. For this
         * reason, ApiStashEdit will skip any ParserOutput that has custom DataUpdates.
         *
         * @since 1.20
                $this->mLimitReportData[$key] = $value;
        }
  
+       /**
+        * Check whether the cache TTL was lowered due to dynamic content
+        *
+        * When content is determined by more than hard state (e.g. page edits),
+        * such as template/file transclusions based on the current timestamp or
+        * extension tags that generate lists based on queries, this return true.
+        *
+        * @return bool
+        * @since 1.25
+        */
+       public function hasDynamicContent() {
+               global $wgParserCacheExpireTime;
+               return $this->getCacheExpiry() < $wgParserCacheExpireTime;
+       }
        /**
         * Get or set the prevent-clickjacking flag
         *