r108891 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108890‎ | r108891 | r108892 >
Date:03:16, 14 January 2012
Author:aaron
Status:ok
Tags:
Comment:
* Fixed bogus var in LSLockManager.
* Made DBLockManager constructor a bit more convenient to use with just 'localDBMaster' in the db buckets.
* Documentation tweaks.
Modified paths:
  • /trunk/phase3/includes/filerepo/backend/SwiftFileBackend.php (modified) (history)
  • /trunk/phase3/includes/filerepo/backend/lockmanager/DBLockManager.php (modified) (history)
  • /trunk/phase3/includes/filerepo/backend/lockmanager/LSLockManager.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/backend/lockmanager/DBLockManager.php
@@ -55,7 +55,9 @@
5656 * @param Array $config
5757 */
5858 public function __construct( array $config ) {
59 - $this->dbServers = $config['dbServers'];
 59+ $this->dbServers = isset( $config['dbServers'] )
 60+ ? $config['dbServers']
 61+ : array(); // likely just using 'localDBMaster'
6062 // Sanitize dbsByBucket config to prevent PHP errors
6163 $this->dbsByBucket = array_filter( $config['dbsByBucket'], 'is_array' );
6264 $this->dbsByBucket = array_values( $this->dbsByBucket ); // consecutive
Index: trunk/phase3/includes/filerepo/backend/lockmanager/LSLockManager.php
@@ -278,7 +278,7 @@
279279 */
280280 protected function getBucketFromKey( $path ) {
281281 $prefix = substr( sha1( $path ), 0, 2 ); // first 2 hex chars (8 bits)
282 - return intval( base_convert( $prefix, 16, 10 ) ) % count( $this->dbsByBucket );
 282+ return intval( base_convert( $prefix, 16, 10 ) ) % count( $this->srvsByBucket );
283283 }
284284
285285 /**
Index: trunk/phase3/includes/filerepo/backend/SwiftFileBackend.php
@@ -16,6 +16,7 @@
1717 * All of the library classes must be registed in $wgAutoloadClasses.
1818 *
1919 * @ingroup FileBackend
 20+ * @since 1.19
2021 */
2122 class SwiftFileBackend extends FileBackend {
2223 /** @var CF_Authentication */
@@ -650,6 +651,7 @@
651652 /**
652653 * SwiftFileBackend helper class to page through object listings.
653654 * Swift also has a listing limit of 10,000 objects for sanity.
 655+ * Do not use this class from places outside SwiftFileBackend.
654656 *
655657 * @ingroup FileBackend
656658 */

Status & tagging log