filebackend: normalize paths used in locking

Change-Id: I0d823e4d20c89a22ad89a6af8739075f7a10c235
This commit is contained in:
Aaron Schulz 2013-07-06 15:06:38 -07:00
parent d975d28f37
commit 5749bd7352

View file

@ -1159,6 +1159,7 @@ abstract class FileBackend {
* @return Status
*/
final public function lockFiles( array $paths, $type ) {
$paths = array_map( 'FileBackend::normalizeStoragePath', $paths );
return $this->lockManager->lock( $paths, $type );
}
@ -1170,6 +1171,7 @@ abstract class FileBackend {
* @return Status
*/
final public function unlockFiles( array $paths, $type ) {
$paths = array_map( 'FileBackend::normalizeStoragePath', $paths );
return $this->lockManager->unlock( $paths, $type );
}
@ -1187,6 +1189,13 @@ abstract class FileBackend {
* @return ScopedLock|null Returns null on failure
*/
final public function getScopedFileLocks( array $paths, $type, Status $status ) {
if ( $type === 'mixed' ) {
foreach ( $paths as &$typePaths ) {
$typePaths = array_map( 'FileBackend::normalizeStoragePath', $typePaths );
}
} else {
$paths = array_map( 'FileBackend::normalizeStoragePath', $paths );
}
return ScopedLock::factory( $this->lockManager, $paths, $type, $status );
}