From: Aaron Schulz Date: Sat, 12 Apr 2014 22:42:34 +0000 (-0700) Subject: Made preloadFileStat/preloadCache actually work for FileBackendMultiWrite X-Git-Tag: 1.31.0-rc.0~16234^2 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=8aaab01e1dbc69170776b8b9a0917de568f8eb21;p=lhc%2Fweb%2Fwiklou.git Made preloadFileStat/preloadCache actually work for FileBackendMultiWrite * Previously the path substitution did not take place Change-Id: I58ad3e2aa44a2b08f4c6bad1a783fb92ea79dbf4 --- diff --git a/includes/filebackend/FileBackend.php b/includes/filebackend/FileBackend.php index 716ab6e449..c75972562c 100644 --- a/includes/filebackend/FileBackend.php +++ b/includes/filebackend/FileBackend.php @@ -1196,8 +1196,7 @@ abstract class FileBackend { * * @param array $paths Storage paths */ - public function preloadCache( array $paths ) { - } + abstract public function preloadCache( array $paths ); /** * Invalidate any in-process file stat and property cache. @@ -1207,8 +1206,7 @@ abstract class FileBackend { * * @param array $paths Storage paths (optional) */ - public function clearCache( array $paths = null ) { - } + abstract public function clearCache( array $paths = null ); /** * Preload file stat information (concurrently if possible) into in-process cache. diff --git a/includes/filebackend/FileBackendMultiWrite.php b/includes/filebackend/FileBackendMultiWrite.php index f00ef65e1d..c39bbaf40e 100644 --- a/includes/filebackend/FileBackendMultiWrite.php +++ b/includes/filebackend/FileBackendMultiWrite.php @@ -662,8 +662,14 @@ class FileBackendMultiWrite extends FileBackend { } } + public function preloadCache( array $paths ) { + $realPaths = $this->substPaths( $paths, $this->backends[$this->masterIndex] ); + $this->backends[$this->masterIndex]->preloadCache( $realPaths ); + } + public function preloadFileStat( array $params ) { - $this->backends[$this->masterIndex]->preloadFileStat( $params ); + $realParams = $this->substOpPaths( $params, $this->backends[$this->masterIndex] ); + $this->backends[$this->masterIndex]->preloadFileStat( $realParams ); } public function getScopedLocksForOps( array $ops, Status $status ) {