Index: trunk/phase3/includes/filerepo/RepoGroup.php |
— | — | @@ -385,4 +385,19 @@ |
386 | 386 | unset( $this->cache[$key] ); |
387 | 387 | } |
388 | 388 | } |
| 389 | + |
| 390 | + /** |
| 391 | + * Clear RepoGroup process cache used for finding a file |
| 392 | + * @param $title Title|null Title of the file or null to clear all files |
| 393 | + */ |
| 394 | + public function clearCache( Title $title = null ) { |
| 395 | + if ( $title == null ) { |
| 396 | + $this->cache = array(); |
| 397 | + } else { |
| 398 | + $dbKey = $title->getDBkey(); |
| 399 | + if ( isset( $this->cache[$dbKey] ) ) { |
| 400 | + unset( $this->cache[$dbKey] ); |
| 401 | + } |
| 402 | + } |
| 403 | + } |
389 | 404 | } |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -3168,8 +3168,8 @@ |
3169 | 3169 | return $err; |
3170 | 3170 | } |
3171 | 3171 | |
3172 | | - // If it is a file, move it first. It is done before all other moving stuff is |
3173 | | - // done because it's hard to revert |
| 3172 | + // If it is a file, move it first. |
| 3173 | + // It is done before all other moving stuff is done because it's hard to revert. |
3174 | 3174 | $dbw = wfGetDB( DB_MASTER ); |
3175 | 3175 | if ( $this->getNamespace() == NS_FILE ) { |
3176 | 3176 | $file = wfLocalFile( $this ); |
— | — | @@ -3180,6 +3180,9 @@ |
3181 | 3181 | } |
3182 | 3182 | } |
3183 | 3183 | } |
| 3184 | + // Clear RepoGroup process cache |
| 3185 | + RepoGroup::singleton()->clearCache( $this ); |
| 3186 | + RepoGroup::singleton()->clearCache( $nt ); # clear false negative cache |
3184 | 3187 | |
3185 | 3188 | $dbw->begin(); # If $file was a LocalFile, its transaction would have closed our own. |
3186 | 3189 | $pageid = $this->getArticleID( self::GAID_FOR_UPDATE ); |