From: Aaron Schulz Date: Fri, 1 Feb 2013 18:55:07 +0000 (-0800) Subject: [LockManager] Renamed getBucketFromKey() -> getBucketFromPath(). X-Git-Tag: 1.31.0-rc.0~20827 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=58b5193ef53bdfa8b99471176ee6b4d6479376cb;p=lhc%2Fweb%2Fwiklou.git [LockManager] Renamed getBucketFromKey() -> getBucketFromPath(). Change-Id: I825dcd255f0b85f81bf925abf46bc46b1fe42e9f --- diff --git a/includes/filebackend/lockmanager/QuorumLockManager.php b/includes/filebackend/lockmanager/QuorumLockManager.php index 4198764e2d..76a3ad6e28 100644 --- a/includes/filebackend/lockmanager/QuorumLockManager.php +++ b/includes/filebackend/lockmanager/QuorumLockManager.php @@ -49,7 +49,7 @@ abstract class QuorumLockManager extends LockManager { } elseif ( isset( $this->locksHeld[$path][self::LOCK_EX] ) ) { $this->locksHeld[$path][$type] = 1; } else { - $bucket = $this->getBucketFromKey( $path ); + $bucket = $this->getBucketFromPath( $path ); $pathsToLock[$bucket][] = $path; } } @@ -92,7 +92,7 @@ abstract class QuorumLockManager extends LockManager { // Reference count the locks held and release locks when zero if ( $this->locksHeld[$path][$type] <= 0 ) { unset( $this->locksHeld[$path][$type] ); - $bucket = $this->getBucketFromKey( $path ); + $bucket = $this->getBucketFromPath( $path ); $pathsToUnlock[$bucket][] = $path; } if ( !count( $this->locksHeld[$path] ) ) { @@ -186,7 +186,7 @@ abstract class QuorumLockManager extends LockManager { * @param $path string * @return integer */ - protected function getBucketFromKey( $path ) { + protected function getBucketFromPath( $path ) { $prefix = substr( sha1( $path ), 0, 2 ); // first 2 hex chars (8 bits) return (int)base_convert( $prefix, 16, 10 ) % count( $this->srvsByBucket ); }