From: Aaron Schulz Date: Fri, 12 Sep 2014 07:54:24 +0000 (-0700) Subject: Removed some b/c code from file backend X-Git-Tag: 1.31.0-rc.0~14065^2 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=d1bc7d2cd9eec381fb9aaf69c4bb713ca29dfbe4;p=lhc%2Fweb%2Fwiklou.git Removed some b/c code from file backend Change-Id: Ie8dbff588b067a202b24dfeaf792301c1077f08b --- diff --git a/includes/filebackend/FileBackend.php b/includes/filebackend/FileBackend.php index 78810eb3ef..8c0a61a1e6 100644 --- a/includes/filebackend/FileBackend.php +++ b/includes/filebackend/FileBackend.php @@ -135,19 +135,12 @@ abstract class FileBackend { */ public function __construct( array $config ) { $this->name = $config['name']; + $this->wikiId = $config['wikiId']; // e.g. "my_wiki-en_" if ( !preg_match( '!^[a-zA-Z0-9-_]{1,255}$!', $this->name ) ) { - throw new FileBackendException( "Backend name `{$this->name}` is invalid." ); - } - if ( !isset( $config['wikiId'] ) ) { - $config['wikiId'] = wfWikiID(); - wfDeprecated( __METHOD__ . ' called without "wikiID".', '1.23' ); + throw new FileBackendException( "Backend name '{$this->name}' is invalid." ); + } elseif ( !is_string( $this->wikiId ) ) { + throw new FileBackendException( "Backend wiki ID not provided for '{$this->name}'." ); } - if ( isset( $config['lockManager'] ) && !is_object( $config['lockManager'] ) ) { - $config['lockManager'] = - LockManagerGroup::singleton( $config['wikiId'] )->get( $config['lockManager'] ); - wfDeprecated( __METHOD__ . ' called with non-object "lockManager".', '1.23' ); - } - $this->wikiId = $config['wikiId']; // e.g. "my_wiki-en_" $this->lockManager = isset( $config['lockManager'] ) ? $config['lockManager'] : new NullLockManager( array() );