diff options
Diffstat (limited to 'includes/filebackend/lockmanager/DBLockManager.php')
-rw-r--r-- | includes/filebackend/lockmanager/DBLockManager.php | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/includes/filebackend/lockmanager/DBLockManager.php b/includes/filebackend/lockmanager/DBLockManager.php index f02387dc..3e934ba5 100644 --- a/includes/filebackend/lockmanager/DBLockManager.php +++ b/includes/filebackend/lockmanager/DBLockManager.php @@ -110,6 +110,19 @@ abstract class DBLockManager extends QuorumLockManager { $this->session = wfRandomString( 31 ); } + // @TODO: change this code to work in one batch + protected function getLocksOnServer( $lockSrv, array $pathsByType ) { + $status = Status::newGood(); + foreach ( $pathsByType as $type => $paths ) { + $status->merge( $this->doGetLocksOnServer( $lockSrv, $paths, $type ) ); + } + return $status; + } + + protected function freeLocksOnServer( $lockSrv, array $pathsByType ) { + return Status::newGood(); + } + /** * @see QuorumLockManager::isServerUp() * @return bool @@ -252,7 +265,7 @@ class MySqlLockManager extends DBLockManager { * @see DBLockManager::getLocksOnServer() * @return Status */ - protected function getLocksOnServer( $lockSrv, array $paths, $type ) { + protected function doGetLocksOnServer( $lockSrv, array $paths, $type ) { $status = Status::newGood(); $db = $this->getConnection( $lockSrv ); // checked in isServerUp() @@ -319,14 +332,6 @@ class MySqlLockManager extends DBLockManager { } /** - * @see QuorumLockManager::freeLocksOnServer() - * @return Status - */ - protected function freeLocksOnServer( $lockSrv, array $paths, $type ) { - return Status::newGood(); // not supported - } - - /** * @see QuorumLockManager::releaseAllLocks() * @return Status */ @@ -361,7 +366,7 @@ class PostgreSqlLockManager extends DBLockManager { self::LOCK_EX => self::LOCK_EX ); - protected function getLocksOnServer( $lockSrv, array $paths, $type ) { + protected function doGetLocksOnServer( $lockSrv, array $paths, $type ) { $status = Status::newGood(); if ( !count( $paths ) ) { return $status; // nothing to lock @@ -369,7 +374,9 @@ class PostgreSqlLockManager extends DBLockManager { $db = $this->getConnection( $lockSrv ); // checked in isServerUp() $bigints = array_unique( array_map( - function( $key ) { return wfBaseConvert( substr( $key, 0, 15 ), 16, 10 ); }, + function( $key ) { + return wfBaseConvert( substr( $key, 0, 15 ), 16, 10 ); + }, array_map( array( $this, 'sha1Base16Absolute' ), $paths ) ) ); @@ -406,14 +413,6 @@ class PostgreSqlLockManager extends DBLockManager { } /** - * @see QuorumLockManager::freeLocksOnServer() - * @return Status - */ - protected function freeLocksOnServer( $lockSrv, array $paths, $type ) { - return Status::newGood(); // not supported - } - - /** * @see QuorumLockManager::releaseAllLocks() * @return Status */ |