r108305 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108304‎ | r108305 | r108306 >
Date:03:49, 7 January 2012
Author:aaron
Status:ok
Tags:
Comment:
In SwiftFileBackend:
* Added 'shardViaHashLevels' to config options.
* Added function visilibity.
Modified paths:
  • /branches/FileBackend/phase3/includes/filerepo/backend/SwiftFileBackend.php (modified) (history)

Diff [purge]

Index: branches/FileBackend/phase3/includes/filerepo/backend/SwiftFileBackend.php
@@ -33,10 +33,11 @@
3434 /**
3535 * @see FileBackend::__construct()
3636 * Additional $config params include:
37 - * swiftAuthUrl : Swift authentication server URL
38 - * swiftUser : Swift user used by MediaWiki
39 - * swiftKey : Authentication key for the above user (used to get sessions)
40 - * swiftProxyUser : Swift user used for end-user hits to proxy server
 37+ * swiftAuthUrl : Swift authentication server URL
 38+ * swiftUser : Swift user used by MediaWiki
 39+ * swiftKey : Swift authentication key for the above user
 40+ * swiftProxyUser : Swift user used for end-user hits to proxy server
 41+ * shardViaHashLevels : Map of container names to the number of hash levels
4142 */
4243 public function __construct( array $config ) {
4344 parent::__construct( $config );
@@ -50,6 +51,9 @@
5152 $this->swiftProxyUser = isset( $config['swiftProxyUser'] )
5253 ? $config['swiftProxyUser']
5354 : '';
 55+ $this->shardViaHashLevels = isset( $config['shardViaHashLevels'] )
 56+ ? $config['shardViaHashLevels']
 57+ : '';
5458 }
5559
5660 /**
@@ -65,7 +69,7 @@
6670 /**
6771 * @see FileBackend::doStoreInternal()
6872 */
69 - function doStoreInternal( array $params ) {
 73+ protected function doStoreInternal( array $params ) {
7074 $status = Status::newGood();
7175
7276 list( $dstCont, $destRel ) = $this->resolveStoragePathReal( $params['dst'] );
@@ -136,7 +140,7 @@
137141 /**
138142 * @see FileBackend::doCopyInternal()
139143 */
140 - function doCopyInternal( array $params ) {
 144+ protected function doCopyInternal( array $params ) {
141145 $status = Status::newGood();
142146
143147 list( $srcCont, $srcRel ) = $this->resolveStoragePathReal( $params['src'] );
@@ -211,7 +215,7 @@
212216 /**
213217 * @see FileBackend::doDeleteInternal()
214218 */
215 - function doDeleteInternal( array $params ) {
 219+ protected function doDeleteInternal( array $params ) {
216220 $status = Status::newGood();
217221
218222 list( $srcCont, $srcRel ) = $this->resolveStoragePathReal( $params['src'] );
@@ -262,7 +266,7 @@
263267 /**
264268 * @see FileBackend::doCopyInternal()
265269 */
266 - function doCreateInternal( array $params ) {
 270+ protected function doCreateInternal( array $params ) {
267271 $status = Status::newGood();
268272
269273 list( $dstCont, $destRel ) = $this->resolveStoragePathReal( $params['dst'] );
@@ -331,7 +335,7 @@
332336 /**
333337 * @see FileBackend::prepate()
334338 */
335 - function doPrepare( $fullCont, $dir, array $params ) {
 339+ protected function doPrepare( $fullCont, $dir, array $params ) {
336340 $status = Status::newGood();
337341
338342 // (a) Get a swift proxy connection
@@ -355,7 +359,7 @@
356360 /**
357361 * @see FileBackend::secure()
358362 */
359 - function doSecure( $fullCont, $dir, array $params ) {
 363+ protected function doSecure( $fullCont, $dir, array $params ) {
360364 $status = Status::newGood();
361365 // @TODO: restrict container from $this->swiftProxyUser
362366 return $status; // badgers? We don't need no steenking badgers!
@@ -364,7 +368,7 @@
365369 /**
366370 * @see FileBackend::doFileExists()
367371 */
368 - function doFileExists( array $params ) {
 372+ protected function doFileExists( array $params ) {
369373 list( $srcCont, $srcRel ) = $this->resolveStoragePathReal( $params['src'] );
370374 if ( $srcRel === null ) {
371375 return false; // invalid storage path
@@ -394,7 +398,7 @@
395399 /**
396400 * @see FileBackend::doGetFileTimestamp()
397401 */
398 - function doGetFileTimestamp( array $params ) {
 402+ protected function doGetFileTimestamp( array $params ) {
399403 list( $srcCont, $srcRel ) = $this->resolveStoragePathReal( $params['src'] );
400404 if ( $srcRel === null ) {
401405 return false; // invalid storage path
@@ -461,7 +465,7 @@
462466 /**
463467 * @see FileBackend::getFileListInternal()
464468 */
465 - function getFileListInternal( $fullCont, $dir, array $params ) {
 469+ public function getFileListInternal( $fullCont, $dir, array $params ) {
466470 return new SwiftFileIterator( $this, $fullCont, $dir );
467471 }
468472
@@ -498,7 +502,7 @@
499503 /**
500504 * @see FileBackend::getLocalCopy()
501505 */
502 - function getLocalCopy( array $params ) {
 506+ public function getLocalCopy( array $params ) {
503507 list( $srcCont, $srcRel ) = $this->resolveStoragePathReal( $params['src'] );
504508 if ( $srcRel === null ) {
505509 return null;

Status & tagging log