Make sure FSFileBackend clears the php stat cache in clearCache(). Otherwise it will...
authorAaron Schulz <aaron@users.mediawiki.org>
Fri, 20 Jan 2012 21:55:15 +0000 (21:55 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Fri, 20 Jan 2012 21:55:15 +0000 (21:55 +0000)
includes/filerepo/backend/FSFileBackend.php
includes/filerepo/backend/FileBackend.php

index 8aaba70..ee390ee 100644 (file)
@@ -419,6 +419,13 @@ class FSFileBackend extends FileBackend {
                }
        }
 
+       /**
+        * @see FileBackend::doClearCache()
+        */
+       protected function doClearCache( array $paths = null ) {
+               clearstatcache(); // clear the PHP file stat cache
+       }
+
        /**
         * @see FileBackend::getFileListInternal()
         */
index baa18c1..77018ab 100644 (file)
@@ -525,7 +525,7 @@ abstract class FileBackendBase {
         * Invalidate any in-process file existence and property cache.
         * If $paths is given, then only the cache for those files will be cleared.
         *
-        * @param $paths Array Storage paths
+        * @param $paths Array Storage paths (optional)
         * @return void
         */
        abstract public function clearCache( array $paths = null );
@@ -1218,8 +1218,19 @@ abstract class FileBackend extends FileBackendBase {
                                unset( $this->cache[$path] );
                        }
                }
+               $this->doClearCache( $paths );
        }
 
+       /**
+        * Clears any additional stat caches for storage paths
+        * 
+        * @see FileBackendBase::clearCache()
+        * 
+        * @param $paths Array Storage paths (optional)
+        * @return void
+        */
+       protected function doClearCache( array $paths = null ) {}
+
        /**
         * Prune the cache if it is too big to add an item
         *