Index: branches/FileBackend/phase3/includes/filerepo/file/File.php |
— | — | @@ -1150,7 +1150,7 @@ |
1151 | 1151 | */ |
1152 | 1152 | function getThumbUrl( $suffix = false ) { |
1153 | 1153 | $this->assertRepoDefined(); |
1154 | | - $path = $this->repo->getZoneUrl('thumb') . '/' . $this->getUrlRel(); |
| 1154 | + $path = $this->repo->getZoneUrl( 'thumb' ) . '/' . $this->getUrlRel(); |
1155 | 1155 | if ( $suffix !== false ) { |
1156 | 1156 | $path .= '/' . rawurlencode( $suffix ); |
1157 | 1157 | } |
Index: branches/FileBackend/phase3/includes/filerepo/backend/FileBackendMultiWrite.php |
— | — | @@ -2,6 +2,7 @@ |
3 | 3 | /** |
4 | 4 | * @file |
5 | 5 | * @ingroup FileBackend |
| 6 | + * @author Aaron Schulz |
6 | 7 | */ |
7 | 8 | |
8 | 9 | /** |
— | — | @@ -71,7 +72,7 @@ |
72 | 73 | foreach ( $this->fileBackends as $index => $backend ) { |
73 | 74 | $backendOps = $this->substOpPaths( $ops, $backend ); |
74 | 75 | $performOps = array_merge( $performOps, $backend->getOperations( $backendOps ) ); |
75 | | - if ( $index == 0 ) { |
| 76 | + if ( $index == 0 && empty( $opts['nonLocking'] ) ) { |
76 | 77 | // Set "files to lock" from the first batch so we don't try to set all |
77 | 78 | // locks two or three times over (depending on the number of backends). |
78 | 79 | // A lock on one storage path is a lock on all the backends. |
Index: branches/FileBackend/phase3/includes/filerepo/backend/lockmanager/DBLockManager.php |
— | — | @@ -12,6 +12,8 @@ |
13 | 13 | * A majority of peer DBs must agree for a lock to be acquired. |
14 | 14 | * |
15 | 15 | * Caching is used to avoid hitting servers that are down. |
| 16 | + * |
| 17 | + * @ingroup LockManager |
16 | 18 | */ |
17 | 19 | class DBLockManager extends LockManager { |
18 | 20 | /** @var Array Map of DB names to server config */ |
— | — | @@ -374,6 +376,8 @@ |
375 | 377 | /** |
376 | 378 | * MySQL version of DBLockManager that supports shared locks. |
377 | 379 | * All locks are non-blocking, which avoids deadlocks. |
| 380 | + * |
| 381 | + * @ingroup LockManager |
378 | 382 | */ |
379 | 383 | class MySqlLockManager extends DBLockManager { |
380 | 384 | /** @var Array Mapping of lock types to the type actually used */ |
Index: branches/FileBackend/phase3/includes/filerepo/backend/lockmanager/FSLockManager.php |
— | — | @@ -8,6 +8,8 @@ |
9 | 9 | * Do not use this with 'lockDir' set to an NFS mount unless the |
10 | 10 | * NFS client is at least version 2.6.12. Otherwise, the BSD flock() |
11 | 11 | * locks will be ignored; see http://nfs.sourceforge.net/#section_d. |
| 12 | + * |
| 13 | + * @ingroup LockManager |
12 | 14 | */ |
13 | 15 | class FSLockManager extends LockManager { |
14 | 16 | /** @var Array Mapping of lock types to the type actually used */ |
Index: branches/FileBackend/phase3/includes/filerepo/backend/lockmanager/LockManagerGroup.php |
— | — | @@ -2,7 +2,7 @@ |
3 | 3 | /** |
4 | 4 | * Class to handle file lock manager registration |
5 | 5 | * |
6 | | - * @ingroup FileBackend |
| 6 | + * @ingroup LockManager |
7 | 7 | */ |
8 | 8 | class LockManagerGroup { |
9 | 9 | protected static $instance = null; |
— | — | @@ -57,7 +57,7 @@ |
58 | 58 | if ( !isset( $this->managers[$name] ) ) { |
59 | 59 | throw new MWException( "No lock manager defined with the name `$name`." ); |
60 | 60 | } |
61 | | - // Lazy-load the actual backend instance |
| 61 | + // Lazy-load the actual lock manager instance |
62 | 62 | if ( !isset( $this->managers[$name]['instance'] ) ) { |
63 | 63 | $class = $this->managers[$name]['class']; |
64 | 64 | $config = $this->managers[$name]['config']; |
Index: branches/FileBackend/phase3/includes/filerepo/backend/lockmanager/LSLockManager.php |
— | — | @@ -9,6 +9,8 @@ |
10 | 10 | * to one bucket. Each bucket maps to one or several peer servers, each |
11 | 11 | * running LockServerDaemon.php, listening on a designated TCP port. |
12 | 12 | * A majority of peers must agree for a lock to be acquired. |
| 13 | + * |
| 14 | + * @ingroup LockManager |
13 | 15 | */ |
14 | 16 | class LSLockManager extends LockManager { |
15 | 17 | /** @var Array Mapping of lock types to the type actually used */ |
Index: branches/FileBackend/phase3/includes/filerepo/backend/lockmanager/LockManager.php |
— | — | @@ -1,5 +1,11 @@ |
2 | 2 | <?php |
3 | 3 | /** |
| 4 | + * @file |
| 5 | + * @ingroup LockManager |
| 6 | + * @author Aaron Schulz |
| 7 | + */ |
| 8 | + |
| 9 | +/** |
4 | 10 | * Class for handling resource locking. |
5 | 11 | * Locks on resource keys can either be shared or exclusive. |
6 | 12 | * |
— | — | @@ -9,8 +15,9 @@ |
10 | 16 | * Locks should either be non-blocking or have low wait timeouts. |
11 | 17 | * |
12 | 18 | * Subclasses should avoid throwing exceptions at all costs. |
13 | | - * |
14 | | - * @ingroup FileBackend |
| 19 | + * |
| 20 | + * @ingroup LockManager |
| 21 | + * @since 1.19 |
15 | 22 | */ |
16 | 23 | abstract class LockManager { |
17 | 24 | /* Lock types; stronger locks have higher values */ |
— | — | @@ -78,6 +85,9 @@ |
79 | 86 | /** |
80 | 87 | * LockManager helper class to handle scoped locks, which |
81 | 88 | * release when an object is destroyed or goes out of scope. |
| 89 | + * |
| 90 | + * @ingroup LockManager |
| 91 | + * @since 1.19 |
82 | 92 | */ |
83 | 93 | class ScopedLock { |
84 | 94 | /** @var LockManager */ |
Index: branches/FileBackend/phase3/includes/filerepo/backend/FileOp.php |
— | — | @@ -2,6 +2,7 @@ |
3 | 3 | /** |
4 | 4 | * @file |
5 | 5 | * @ingroup FileBackend |
| 6 | + * @author Aaron Schulz |
6 | 7 | */ |
7 | 8 | |
8 | 9 | /** |
— | — | @@ -12,6 +13,7 @@ |
13 | 14 | * potentially many FileOp classes in large arrays in memory. |
14 | 15 | * |
15 | 16 | * @ingroup FileBackend |
| 17 | + * @since 1.19 |
16 | 18 | */ |
17 | 19 | abstract class FileOp { |
18 | 20 | /** $var Array */ |
Index: branches/FileBackend/phase3/includes/filerepo/backend/FSFileBackend.php |
— | — | @@ -2,6 +2,7 @@ |
3 | 3 | /** |
4 | 4 | * @file |
5 | 5 | * @ingroup FileBackend |
| 6 | + * @author Aaron Schulz |
6 | 7 | */ |
7 | 8 | |
8 | 9 | /** |
— | — | @@ -126,10 +127,6 @@ |
127 | 128 | return $status; |
128 | 129 | } |
129 | 130 | |
130 | | - function canMove( array $params ) { |
131 | | - return true; |
132 | | - } |
133 | | - |
134 | 131 | function move( array $params ) { |
135 | 132 | $status = Status::newGood(); |
136 | 133 | |
Index: branches/FileBackend/phase3/includes/filerepo/backend/FileBackend.php |
— | — | @@ -2,6 +2,7 @@ |
3 | 3 | /** |
4 | 4 | * @file |
5 | 5 | * @ingroup FileBackend |
| 6 | + * @author Aaron Schulz |
6 | 7 | */ |
7 | 8 | |
8 | 9 | /** |
— | — | @@ -21,6 +22,7 @@ |
22 | 23 | * As a corollary, external dependencies should be kept to a minimum. |
23 | 24 | * |
24 | 25 | * @ingroup FileBackend |
| 26 | + * @since 1.19 |
25 | 27 | */ |
26 | 28 | abstract class FileBackendBase { |
27 | 29 | protected $name; // unique backend name |
— | — | @@ -111,8 +113,7 @@ |
112 | 114 | * 'op' => 'concatenate', |
113 | 115 | * 'srcs' => <ordered array of storage paths>, |
114 | 116 | * 'dst' => <storage path>, |
115 | | - * 'overwriteDest' => <boolean>, |
116 | | - * 'overwriteSame' => <boolean> |
| 117 | + * 'overwriteDest' => <boolean> |
117 | 118 | * ) |
118 | 119 | * g) Do nothing (no-op) |
119 | 120 | * array( |
— | — | @@ -352,6 +353,7 @@ |
353 | 354 | * This class defines the methods as abstract that subclasses must implement. |
354 | 355 | * |
355 | 356 | * @ingroup FileBackend |
| 357 | + * @since 1.19 |
356 | 358 | */ |
357 | 359 | abstract class FileBackend extends FileBackendBase { |
358 | 360 | /** |
— | — | @@ -381,6 +383,17 @@ |
382 | 384 | abstract public function copy( array $params ); |
383 | 385 | |
384 | 386 | /** |
| 387 | + * Delete a file at the storage path. |
| 388 | + * Do not call this function from places outside FileBackend and FileOp. |
| 389 | + * $params include: |
| 390 | + * src : source storage path |
| 391 | + * |
| 392 | + * @param $params Array |
| 393 | + * @return Status |
| 394 | + */ |
| 395 | + abstract public function delete( array $params ); |
| 396 | + |
| 397 | + /** |
385 | 398 | * Move a file from one storage path to another in the backend. |
386 | 399 | * Do not call this function from places outside FileBackend and FileOp. |
387 | 400 | * $params include: |
— | — | @@ -403,17 +416,6 @@ |
404 | 417 | } |
405 | 418 | |
406 | 419 | /** |
407 | | - * Delete a file at the storage path. |
408 | | - * Do not call this function from places outside FileBackend and FileOp. |
409 | | - * $params include: |
410 | | - * src : source storage path |
411 | | - * |
412 | | - * @param $params Array |
413 | | - * @return Status |
414 | | - */ |
415 | | - abstract public function delete( array $params ); |
416 | | - |
417 | | - /** |
418 | 420 | * Combines files from several storage paths into a new file in the backend. |
419 | 421 | * Do not call this function from places outside FileBackend and FileOp. |
420 | 422 | * $params include: |
— | — | @@ -548,7 +550,7 @@ |
549 | 551 | // Build up a list of FileOps... |
550 | 552 | $performOps = $this->getOperations( $ops ); |
551 | 553 | |
552 | | - if ( !isset( $opts['nonLocking'] ) || !$opts['nonLocking'] ) { |
| 554 | + if ( empty( $opts['nonLocking'] ) ) { |
553 | 555 | // Build up a list of files to lock... |
554 | 556 | $filesLockEx = $filesLockSh = array(); |
555 | 557 | foreach ( $performOps as $index => $fileOp ) { |