r109815 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109814‎ | r109815 | r109816 >
Date:11:03, 23 January 2012
Author:hashar
Status:reverted (Comments)
Tags:
Comment:
cleanly handle wikiId on FileBackendBase construction

Use the default array added by r109814
Modified paths:
  • /trunk/phase3/includes/filerepo/backend/FileBackend.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/backend/FileBackend.php
@@ -53,13 +53,11 @@
5454 public function __construct( array $config ) {
5555 $defaultConfig = array(
5656 'lockManager' => null,
 57+ 'wikiId' => wfWikiID(),
5758 );
5859 $config = array_merge( $defaultConfig, $config );
5960 $this->name = $config['name'];
60 - $this->wikiId = isset( $config['wikiId'] )
61 - ? $config['wikiId']
62 - : wfWikiID(); // e.g. "my_wiki-en_"
63 - $this->wikiId = $this->resolveWikiId( $this->wikiId );
 61+ $this->wikiId = $this->resolveWikiId( $config['wikiId'] );
6462 $this->lockManager = LockManagerGroup::singleton()->get( $config['lockManager'] );
6563 $this->readOnly = isset( $config['readOnly'] )
6664 ? (string)$config['readOnly']

Follow-up revisions

RevisionCommit summaryAuthorDate
r109855reverts r109814 r109815...hashar21:56, 23 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r109814get a null lock manager by defaulthashar10:59, 23 January 2012

Comments

#Comment by Aaron Schulz (talk | contribs)   20:43, 23 January 2012

Why not use '$config = $config + $defaultConfig;'?

Status & tagging log