Merge "[FileBackend] Added preloadCache() so callers can trigger cache getMulti()."
[lhc/web/wiklou.git] / includes / filebackend / FileBackendStore.php
index 9311a90..9bec145 100644 (file)
@@ -1108,6 +1108,20 @@ abstract class FileBackendStore extends FileBackend {
                return array();
        }
 
+       /**
+        * @see FileBackend::preloadCache()
+        */
+       final public function preloadCache( array $paths ) {
+               $fullConts = array(); // full container names
+               foreach ( $paths as $path ) {
+                       list( $fullCont, $r, $s ) = $this->resolveStoragePath( $path );
+                       $fullConts[] = $fullCont;
+               }
+               // Load from the persistent file and container caches
+               $this->primeContainerCache( $fullConts );
+               $this->primeFileCache( $paths );
+       }
+
        /**
         * @see FileBackend::clearCache()
         */