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