Merge "Add templateOverridesBySection to multi LBFactory"
[lhc/web/wiklou.git] / includes / site / SiteSQLStore.php
1 <?php
2
3 /**
4 * Dummy class for accessing the global SiteStore instance.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 * http://www.gnu.org/copyleft/gpl.html
20 *
21 * @since 1.21
22 *
23 * @file
24 * @ingroup Site
25 *
26 * @deprecated 1.27 use DBSiteStore and CachingSiteStore instead.
27 *
28 * @license GNU GPL v2+
29 * @author Daniel Kinzler
30 */
31 class SiteSQLStore {
32
33 /**
34 * Returns the global SiteStore instance. This is a relict of the first implementation
35 * of SiteStore, and is kept around for compatibility.
36 *
37 * @note This does not return an instance of SiteSQLStore!
38 *
39 * @since 1.21
40 * @deprecated 1.27 use MediaWikiServices::getSiteStore() or MediaWikiServices::getSiteLookup()
41 * instead.
42 *
43 * @param null $sitesTable IGNORED
44 * @param null $cache IGNORED
45 *
46 * @return SiteStore
47 */
48 public static function newInstance( $sitesTable = null, BagOStuff $cache = null ) {
49 if ( $sitesTable !== null ) {
50 throw new InvalidArgumentException(
51 __METHOD__ . ': $sitesTable parameter is unused and must be null'
52 );
53 }
54
55 // NOTE: we silently ignore $cache for now, since some existing callers
56 // specify it. If we break compatibility with them, we could just as
57 // well just remove this class.
58
59 return \MediaWiki\MediaWikiServices::getInstance()->getSiteStore();
60 }
61
62 }