Remove unused LBFactoryFake class
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 15 Sep 2016 05:02:43 +0000 (22:02 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 15 Sep 2016 05:02:43 +0000 (22:02 -0700)
Change-Id: I88acf72fc32c7e3c9bead81d11c5adfd8dff6151

autoload.php
includes/db/loadbalancer/LBFactory.php
includes/db/loadbalancer/LBFactoryFake.php [deleted file]
tests/phpunit/includes/db/LBFactoryTest.php

index 1ebf728..d46d2ce 100644 (file)
@@ -654,7 +654,6 @@ $wgAutoloadLocalClasses = [
        'KkConverter' => __DIR__ . '/languages/classes/LanguageKk.php',
        'KuConverter' => __DIR__ . '/languages/classes/LanguageKu.php',
        'LBFactory' => __DIR__ . '/includes/db/loadbalancer/LBFactory.php',
-       'LBFactoryFake' => __DIR__ . '/includes/db/loadbalancer/LBFactoryFake.php',
        'LBFactoryMulti' => __DIR__ . '/includes/db/loadbalancer/LBFactoryMulti.php',
        'LBFactorySimple' => __DIR__ . '/includes/db/loadbalancer/LBFactorySimple.php',
        'LBFactorySingle' => __DIR__ . '/includes/db/loadbalancer/LBFactorySingle.php',
index 9eda742..6fd1550 100644 (file)
@@ -138,7 +138,6 @@ abstract class LBFactory implements DestructibleService {
                        'LBFactory_Simple' => 'LBFactorySimple',
                        'LBFactory_Single' => 'LBFactorySingle',
                        'LBFactory_Multi' => 'LBFactoryMulti',
-                       'LBFactory_Fake' => 'LBFactoryFake',
                ];
 
                $class = $config['class'];
diff --git a/includes/db/loadbalancer/LBFactoryFake.php b/includes/db/loadbalancer/LBFactoryFake.php
deleted file mode 100644 (file)
index 5cd1d4b..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php
-/**
- * Generator of database load balancing objects.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Database
- */
-
-/**
- * LBFactory class that throws an error on any attempt to use it.
- * This will typically be done via wfGetDB().
- * Call LBFactory::disableBackend() to start using this, and
- * LBFactory::enableBackend() to return to normal behavior
- */
-class LBFactoryFake extends LBFactory {
-       public function newMainLB( $wiki = false ) {
-               throw new DBAccessError;
-       }
-
-       public function getMainLB( $wiki = false ) {
-               throw new DBAccessError;
-       }
-
-       protected function newExternalLB( $cluster, $wiki = false ) {
-               throw new DBAccessError;
-       }
-
-       public function getExternalLB( $cluster, $wiki = false ) {
-               throw new DBAccessError;
-       }
-
-       public function forEachLB( $callback, array $params = [] ) {
-       }
-}
index 862ec42..364a6c2 100644 (file)
@@ -54,7 +54,6 @@ class LBFactoryTest extends MediaWikiTestCase {
                        [ 'LBFactorySimple', 'LBFactory_Simple' ],
                        [ 'LBFactorySingle', 'LBFactory_Single' ],
                        [ 'LBFactoryMulti', 'LBFactory_Multi' ],
-                       [ 'LBFactoryFake', 'LBFactory_Fake' ],
                ];
        }