From ab0aaa6eba7bea3895248c822ddbeb028399e7f2 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sun, 27 Jan 2013 22:36:28 -0800 Subject: [PATCH] [FileBackend] Added duplicate backend check. * Not sure when this disappeared from before. Change-Id: I69a8ce06b2f3bae0e65fb65b63440eb0a2e1128c --- includes/filebackend/FileBackendGroup.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/filebackend/FileBackendGroup.php b/includes/filebackend/FileBackendGroup.php index 8bbc96d0de..53272045a9 100644 --- a/includes/filebackend/FileBackendGroup.php +++ b/includes/filebackend/FileBackendGroup.php @@ -122,7 +122,9 @@ class FileBackendGroup { throw new MWException( "Cannot register a backend with no name." ); } $name = $config['name']; - if ( !isset( $config['class'] ) ) { + if ( isset( $this->backends[$name] ) ) { + throw new MWException( "Backend with name `{$name}` already registered." ); + } elseif ( !isset( $config['class'] ) ) { throw new MWException( "Cannot register backend `{$name}` with no class." ); } $class = $config['class']; -- 2.20.1