cleanly handle wikiId on FileBackendBase construction
authorAntoine Musso <hashar@users.mediawiki.org>
Mon, 23 Jan 2012 11:03:45 +0000 (11:03 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Mon, 23 Jan 2012 11:03:45 +0000 (11:03 +0000)
Use the default array added by r109814

includes/filerepo/backend/FileBackend.php

index dcd0317..98e1187 100644 (file)
@@ -53,13 +53,11 @@ abstract class FileBackendBase {
        public function __construct( array $config ) {
                $defaultConfig = array(
                        'lockManager' => null,
+                       'wikiId' => wfWikiID(),
                );
                $config = array_merge(  $defaultConfig, $config );
                $this->name = $config['name'];
-               $this->wikiId = isset( $config['wikiId'] )
-                       ? $config['wikiId']
-                       : wfWikiID(); // e.g. "my_wiki-en_"
-               $this->wikiId = $this->resolveWikiId( $this->wikiId );
+               $this->wikiId = $this->resolveWikiId( $config['wikiId'] );
                $this->lockManager = LockManagerGroup::singleton()->get( $config['lockManager'] );
                $this->readOnly = isset( $config['readOnly'] )
                        ? (string)$config['readOnly']