protected $dbHandleFunc;
/** @var ProcessCacheLRU */
protected $resolvedPathCache;
- /** @var Array Map of (index => DBConnRef) */
+ /** @var DBConnRef[] */
protected $dbs;
public function __construct( array $config ) {
*/
public function getBackendPaths( array $paths, $latest = true ) {
$db = $this->getDB( $latest ? DB_MASTER : DB_SLAVE );
- $origBasePath = $this->backend->getContainerStoragePath( "{$this->repoName}-original" );
// @TODO: batching
$resolved = array();
continue;
}
- list( , $container, $rel ) = FileBackend::splitStoragePath( $path );
+ list( , $container ) = FileBackend::splitStoragePath( $path );
if ( $container === "{$this->repoName}-public" ) {
$name = basename( $path );
}
public function getScopedLocksForOps( array $ops, Status $status ) {
- return $this->backend->getScopedFileLocks( $ops, $status );
+ return $this->backend->getScopedLocksForOps( $ops, $status );
}
/**
*/
public function getPathForSHA1( $sha1 ) {
if ( strlen( $sha1 ) < 3 ) {
- throw new MWException( "Invalid file SHA-1." );
+ throw new InvalidArgumentException( "Invalid file SHA-1." );
}
return $this->backend->getContainerStoragePath( "{$this->repoName}-original" ) .
"/{$sha1[0]}/{$sha1[1]}/{$sha1[2]}/{$sha1}";
* @return DBConnRef
*/
protected function getDB( $index ) {
- if ( !isset( $this->db[$index] ) ) {
+ if ( !isset( $this->dbs[$index] ) ) {
$func = $this->dbHandleFunc;
- $this->db[$index] = $func( $index );
+ $this->dbs[$index] = $func( $index );
}
- return $this->db[$index];
+ return $this->dbs[$index];
}
/**