User "Tim Starling" posted a comment on MediaWiki.r84610.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/84610#c22524
Commit summary:

* Put parser output file version tracking to core
* Added some ParserOutput accessors
* A few cleanups to fetchFile()

Comment:

There's nothing wrong with file tracking. I'm just saying that the time should 
be stored in an associative array along with any other relevant options, so 
that the ParserOutput interface can be more stable. Something like

<syntaxhighlight lang=diff>
Index: dataclasses/FlaggedRevs.class.php
===================================================================
--- dataclasses/FlaggedRevs.class.php   (revision 96956)
+++ dataclasses/FlaggedRevs.class.php   (working copy)
@@ -595,7 +595,7 @@
         * @return bool
         */
        public static function parserOutputIsVersioned( ParserOutput $pOut ) {
-               return ( $pOut->getTemplateIds() !== null && 
$pOut->getImageTimeKeys() !== null );
+               return ( $pOut->getTemplateIds() !== null && 
$pOut->getFileSearchOptions() !== null );
        }
 
        # ################ Tracking/cache update update functions 
#################
Index: presentation/FlaggedPageView.php
===================================================================
--- presentation/FlaggedPageView.php    (revision 96956)
+++ presentation/FlaggedPageView.php    (working copy)
@@ -1103,7 +1103,13 @@
                        # Note: showStableVersion() already makes sure that 
$wgOut has the stable inclusion versions.
                        if ( $this->out->getRevisionId() == $rev->getId() && 
empty( $this->out->fr_unversionedIncludes ) ) {
                                $tmpVers = $this->out->getTemplateIds();
-                               $fileVers = $this->out->getImageTimeKeys();
+                               $fileOptions = 
$this->out->getFileSearchOptions();
+                               $fileVers = array();
+                               foreach ( $fileOptions as $fileName => $opt ) {
+                                       if ( isset( $opt['time'] ) ) {
+                                               $fileVers[$fileName] = 
$opt['time'];
+                                       }
+                               }
                        } elseif ( $this->oldRevIncludes ) { // e.g. 
diffonly=1, stable diff
                                # We may have already fetched the inclusion IDs 
to get the template/file changes.
                                list( $tmpVers, $fileVers ) = 
$this->oldRevIncludes; // reuse
</syntaxhighlight>

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to