X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ffilerepo%2FFileBackendDBRepoWrapper.php;h=b4454878cd4e51d1d106c1136d6fa25dfc6408fa;hb=91a693919e2e704114f2e69e3282577e4c47bb15;hp=dbb542172d8372d35d33f573e4f2e76d7c03685e;hpb=a7c20422341cf6c2556fe6093763e5dfd409a244;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/FileBackendDBRepoWrapper.php b/includes/filerepo/FileBackendDBRepoWrapper.php index dbb542172d..b4454878cd 100644 --- a/includes/filerepo/FileBackendDBRepoWrapper.php +++ b/includes/filerepo/FileBackendDBRepoWrapper.php @@ -45,7 +45,7 @@ class FileBackendDBRepoWrapper extends FileBackend { protected $repoName; /** @var Closure */ protected $dbHandleFunc; - /** @var ProcessCacheLRU */ + /** @var MapCacheLRU */ protected $resolvedPathCache; /** @var DBConnRef[] */ protected $dbs; @@ -59,7 +59,7 @@ class FileBackendDBRepoWrapper extends FileBackend { $this->backend = $config['backend']; $this->repoName = $config['repoName']; $this->dbHandleFunc = $config['dbHandleFactory']; - $this->resolvedPathCache = new ProcessCacheLRU( 100 ); + $this->resolvedPathCache = new MapCacheLRU( 100 ); } /** @@ -102,8 +102,8 @@ class FileBackendDBRepoWrapper extends FileBackend { // @TODO: batching $resolved = []; foreach ( $paths as $i => $path ) { - if ( !$latest && $this->resolvedPathCache->has( $path, 'target', 10 ) ) { - $resolved[$i] = $this->resolvedPathCache->get( $path, 'target' ); + if ( !$latest && $this->resolvedPathCache->hasField( $path, 'target', 10 ) ) { + $resolved[$i] = $this->resolvedPathCache->getField( $path, 'target' ); continue; } @@ -127,12 +127,12 @@ class FileBackendDBRepoWrapper extends FileBackend { continue; } $resolved[$i] = $this->getPathForSHA1( $sha1 ); - $this->resolvedPathCache->set( $path, 'target', $resolved[$i] ); + $this->resolvedPathCache->setField( $path, 'target', $resolved[$i] ); } elseif ( $container === "{$this->repoName}-deleted" ) { $name = basename( $path ); // . $sha1 = substr( $name, 0, strpos( $name, '.' ) ); // ignore extension $resolved[$i] = $this->getPathForSHA1( $sha1 ); - $this->resolvedPathCache->set( $path, 'target', $resolved[$i] ); + $this->resolvedPathCache->setField( $path, 'target', $resolved[$i] ); } else { $resolved[$i] = $path; }