* @param $config Array
*/
public function __construct( array $config ) {
- $defaultConfig = array(
- 'lockManager' => null,
- 'wikiId' => wfWikiID(),
- );
- $config = array_merge( $defaultConfig, $config );
$this->name = $config['name'];
- $this->wikiId = $this->resolveWikiId( $config['wikiId'] );
+ $this->wikiId = isset( $config['wikiId'] )
+ ? $config['wikiId']
+ : wfWikiID(); // e.g. "my_wiki-en_"
+ $this->wikiId = $this->resolveWikiId( $this->wikiId );
$this->lockManager = LockManagerGroup::singleton()->get( $config['lockManager'] );
$this->readOnly = isset( $config['readOnly'] )
? (string)$config['readOnly']
/**
* Get the lock manager object with a given name
*
- * @param $name string. Empty value (default) will give a nullLockManager
- * @return LockManager (default: nullLockManager)
+ * @param $name string
+ * @return LockManager
* @throws MWException
*/
- public function get( $name = null ) {
- if( empty( $name ) ) {
- $name = 'nullLockManager';
- }
+ public function get( $name ) {
if ( !isset( $this->managers[$name] ) ) {
throw new MWException( "No lock manager defined with the name `$name`." );
}