r97087 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97086‎ | r97087 | r97088 >
Date:19:05, 14 September 2011
Author:aaron
Status:ok
Tags:
Comment:
FU r84610: Renamed getImageTimeKeys() to getFileSearchOptions()
Modified paths:
  • /trunk/extensions/FlaggedRevs/dataclasses/FRInclusionCache.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevs.class.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/presentation/FlaggedPageView.php (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/includes/parser/ParserOutput.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/ParserOutput.php
@@ -124,7 +124,7 @@
125125 $mDistantTemplates = array(), # 3-D map of WIKIID/NS/DBK to ID for the template references. ID=zero for broken.
126126 $mDistantTemplateIds = array(), # 3-D map of WIKIID/NS/DBK to rev ID for the template references. ID=zero for broken.
127127 $mImages = array(), # DB keys of the images used, in the array key only
128 - $mImageTimeKeys = array(), # DB keys of the images used mapped to sha1 and MW timestamp
 128+ $mFileSearchOptions = array(), # DB keys of the images used mapped to sha1 and MW timestamp
129129 $mExternalLinks = array(), # External link URLs, in the key only
130130 $mInterwikiLinks = array(), # 2-D map of prefix/DBK (in keys only) for the inline interwiki links in the document.
131131 $mNewSection = false, # Show a new section link?
@@ -197,7 +197,7 @@
198198 function &getDistantTemplateIds() { return $this->mDistantTemplateIds; }
199199 function &getTemplateIds() { return $this->mTemplateIds; }
200200 function &getImages() { return $this->mImages; }
201 - function &getImageTimeKeys() { return $this->mImageTimeKeys; }
 201+ function &getFileSearchOptions() { return $this->mFileSearchOptions; }
202202 function &getExternalLinks() { return $this->mExternalLinks; }
203203 function getNoGallery() { return $this->mNoGallery; }
204204 function getHeadItems() { return $this->mHeadItems; }
@@ -292,7 +292,7 @@
293293 function addImage( $name, $timestamp = null, $sha1 = null ) {
294294 $this->mImages[$name] = 1;
295295 if ( $timestamp !== null && $sha1 !== null ) {
296 - $this->mImageTimeKeys[$name] = array( 'time' => $timestamp, 'sha1' => $sha1 );
 296+ $this->mFileSearchOptions[$name] = array( 'time' => $timestamp, 'sha1' => $sha1 );
297297 }
298298 }
299299
Index: trunk/phase3/includes/OutputPage.php
@@ -1301,7 +1301,7 @@
13021302 * @return Array (dbKey => array('time' => MW timestamp or null, 'sha1' => sha1 or ''))
13031303 * @since 1.18
13041304 */
1305 - public function getImageTimeKeys() {
 1305+ public function getFileSearchOptions() {
13061306 return $this->mImageTimeKeys;
13071307 }
13081308
@@ -1415,7 +1415,7 @@
14161416 }
14171417 }
14181418 // File versioning...
1419 - foreach ( (array)$parserOutput->getImageTimeKeys() as $dbk => $data ) {
 1419+ foreach ( (array)$parserOutput->getFileSearchOptions() as $dbk => $data ) {
14201420 $this->mImageTimeKeys[$dbk] = $data;
14211421 }
14221422
Index: trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevs.class.php
@@ -595,7 +595,7 @@
596596 * @return bool
597597 */
598598 public static function parserOutputIsVersioned( ParserOutput $pOut ) {
599 - return ( $pOut->getTemplateIds() !== null && $pOut->getImageTimeKeys() !== null );
 599+ return ( $pOut->getTemplateIds() !== null && $pOut->getFileSearchOptions() !== null );
600600 }
601601
602602 # ################ Tracking/cache update update functions #################
@@ -994,7 +994,7 @@
995995 'img_timestamp' => $fileData['timestamp'],
996996 'img_sha1' => $fileData['sha1'],
997997 'templateVersions' => $poutput->getTemplateIds(),
998 - 'fileVersions' => $poutput->getImageTimeKeys(),
 998+ 'fileVersions' => $poutput->getFileSearchOptions(),
999999 'flags' => implode( ',', $propFlags ),
10001000 ) );
10011001 $flaggedRevision->insert();
Index: trunk/extensions/FlaggedRevs/dataclasses/FRInclusionCache.php
@@ -43,7 +43,7 @@
4444 $rev->getText(), $title, $pOpts, true, true, $rev->getId() );
4545 }
4646 # Get the template/file versions used...
47 - $versions = array( $pOut->getTemplateIds(), $pOut->getImageTimeKeys() );
 47+ $versions = array( $pOut->getTemplateIds(), $pOut->getFileSearchOptions() );
4848 # Save to cache (check cache expiry for dynamic elements)...
4949 $data = FlaggedRevs::makeMemcObj( $versions );
5050 $wgMemc->set( $key, $data, $pOut->getCacheExpiry() );
@@ -81,7 +81,7 @@
8282 global $wgMemc;
8383 $key = self::getCacheKey( $title, $revId );
8484 # Get the template/file versions used...
85 - $versions = array( $pOut->getTemplateIds(), $pOut->getImageTimeKeys() );
 85+ $versions = array( $pOut->getTemplateIds(), $pOut->getFileSearchOptions() );
8686 # Save to cache (check cache expiry for dynamic elements)...
8787 $data = FlaggedRevs::makeMemcObj( $versions );
8888 $wgMemc->set( $key, $data, $pOut->getCacheExpiry() );
Index: trunk/extensions/FlaggedRevs/presentation/FlaggedPageView.php
@@ -1103,7 +1103,7 @@
11041104 # Note: showStableVersion() already makes sure that $wgOut has the stable inclusion versions.
11051105 if ( $this->out->getRevisionId() == $rev->getId() && empty( $this->out->fr_unversionedIncludes ) ) {
11061106 $tmpVers = $this->out->getTemplateIds();
1107 - $fileVers = $this->out->getImageTimeKeys();
 1107+ $fileVers = $this->out->getFileSearchOptions();
11081108 } elseif ( $this->oldRevIncludes ) { // e.g. diffonly=1, stable diff
11091109 # We may have already fetched the inclusion IDs to get the template/file changes.
11101110 list( $tmpVers, $fileVers ) = $this->oldRevIncludes; // reuse

Follow-up revisions

RevisionCommit summaryAuthorDate
r97173Merged revisions 97087,97091-97092,97094,97096-97098,97100-97101,97103,97136,...dantman16:19, 15 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r84610* Put parser output file version tracking to core...aaron17:35, 23 March 2011

Status & tagging log