Index: trunk/phase3/includes/filerepo/backend/lockmanager/LockManagerGroup.php |
— | — | @@ -66,11 +66,14 @@ |
67 | 67 | /** |
68 | 68 | * Get the lock manager object with a given name |
69 | 69 | * |
70 | | - * @param $name string |
71 | | - * @return LockManager |
| 70 | + * @param $name string. Empty value (default) will give a nullLockManager |
| 71 | + * @return LockManager (default: nullLockManager) |
72 | 72 | * @throws MWException |
73 | 73 | */ |
74 | | - public function get( $name ) { |
| 74 | + public function get( $name = null ) { |
| 75 | + if( empty( $name ) ) { |
| 76 | + $name = 'nullLockManager'; |
| 77 | + } |
75 | 78 | if ( !isset( $this->managers[$name] ) ) { |
76 | 79 | throw new MWException( "No lock manager defined with the name `$name`." ); |
77 | 80 | } |
Index: trunk/phase3/includes/filerepo/backend/FileBackend.php |
— | — | @@ -51,6 +51,10 @@ |
52 | 52 | * @param $config Array |
53 | 53 | */ |
54 | 54 | public function __construct( array $config ) { |
| 55 | + $defaultConfig = array( |
| 56 | + 'lockManager' => null, |
| 57 | + ); |
| 58 | + $config = array_merge( $defaultConfig, $config ); |
55 | 59 | $this->name = $config['name']; |
56 | 60 | $this->wikiId = isset( $config['wikiId'] ) |
57 | 61 | ? $config['wikiId'] |