Move class SearchEngineDummy to own file
authorUmherirrender <umherirrender_de.wp@web.de>
Fri, 29 Mar 2019 19:35:35 +0000 (20:35 +0100)
committerUmherirrender <umherirrender_de.wp@web.de>
Fri, 29 Mar 2019 19:35:35 +0000 (20:35 +0100)
Each class should have its own file, even it is a no-op

Change-Id: I90124ed35e354c546fcd69d52dc1febb71b2c71f

.phpcs.xml
autoload.php
includes/search/SearchEngine.php
includes/search/SearchEngineDummy.php [new file with mode: 0644]

index 2436fa7..80b3e41 100644 (file)
                <exclude-pattern>*/includes/parser/Preprocessor\.php</exclude-pattern>
                <exclude-pattern>*/includes/PathRouter\.php</exclude-pattern>
                <exclude-pattern>*/includes/profiler/SectionProfiler\.php</exclude-pattern>
-               <exclude-pattern>*/includes/search/SearchEngine\.php</exclude-pattern>
                <exclude-pattern>*/includes/specialpage/LoginSignupSpecialPage\.php</exclude-pattern>
                <exclude-pattern>*/includes/specials/forms/PreferencesFormLegacy\.php</exclude-pattern>
                <exclude-pattern>*/includes/StubObject\.php</exclude-pattern>
index 2abf2f8..6f25ebe 100644 (file)
@@ -1300,7 +1300,7 @@ $wgAutoloadLocalClasses = [
        'SearchDump' => __DIR__ . '/maintenance/dumpIterator.php',
        'SearchEngine' => __DIR__ . '/includes/search/SearchEngine.php',
        'SearchEngineConfig' => __DIR__ . '/includes/search/SearchEngineConfig.php',
-       'SearchEngineDummy' => __DIR__ . '/includes/search/SearchEngine.php',
+       'SearchEngineDummy' => __DIR__ . '/includes/search/SearchEngineDummy.php',
        'SearchEngineFactory' => __DIR__ . '/includes/search/SearchEngineFactory.php',
        'SearchExactMatchRescorer' => __DIR__ . '/includes/search/SearchExactMatchRescorer.php',
        'SearchHighlighter' => __DIR__ . '/includes/search/SearchHighlighter.php',
index 0b29dd7..4cba19e 100644 (file)
@@ -894,13 +894,3 @@ abstract class SearchEngine {
                }
        }
 }
-
-/**
- * Dummy class to be used when non-supported Database engine is present.
- * @todo FIXME: Dummy class should probably try something at least mildly useful,
- * such as a LIKE search through titles.
- * @ingroup Search
- */
-class SearchEngineDummy extends SearchEngine {
-       // no-op
-}
diff --git a/includes/search/SearchEngineDummy.php b/includes/search/SearchEngineDummy.php
new file mode 100644 (file)
index 0000000..b3db28b
--- /dev/null
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Dummy search engine
+ *
+ * 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 Search
+ */
+
+/**
+ * Dummy class to be used when non-supported Database engine is present.
+ * @todo FIXME: Dummy class should probably try something at least mildly useful,
+ * such as a LIKE search through titles.
+ * @ingroup Search
+ */
+class SearchEngineDummy extends SearchEngine {
+       // no-op
+}