r110153 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110152‎ | r110153 | r110154 >
Date:18:21, 27 January 2012
Author:aaron
Status:ok (Comments)
Tags:filebackend 
Comment:
r107980: added missing dir param to FileBackendShardListIterator
Modified paths:
  • /trunk/phase3/includes/filerepo/backend/FileBackend.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/backend/FileBackend.php
@@ -1255,14 +1255,15 @@
12561256 * @see FileBackendBase::clearCache()
12571257 */
12581258 final public function clearCache( array $paths = null ) {
 1259+ if ( is_array( $paths ) ) {
 1260+ $paths = array_map( 'FileBackend::normalizeStoragePath', $paths );
 1261+ $paths = array_filter( $paths, 'strlen' ); // remove nulls
 1262+ }
12591263 if ( $paths === null ) {
12601264 $this->cache = array();
12611265 } else {
12621266 foreach ( $paths as $path ) {
1263 - $path = self::normalizeStoragePath( $path );
1264 - if ( $path !== null ) {
1265 - unset( $this->cache[$path] );
1266 - }
 1267+ unset( $this->cache[$path] );
12671268 }
12681269 }
12691270 $this->doClearCache( $paths );

Comments

#Comment by Aaron Schulz (talk | contribs)   18:24, 27 January 2012

Summary should be 'r110084: normalize paths before passing them to doClearCache() to make things a bit easier for any subclasses that use them.'.

Status & tagging log