Merge "Clean up zh-tw.json"
[lhc/web/wiklou.git] / includes / site / SiteSQLStore.php
1 <?php
2
3 /**
4 * Represents the site configuration of a wiki.
5 * Holds a list of sites (ie SiteList) and takes care
6 * of retrieving and caching site information when appropriate.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 * http://www.gnu.org/copyleft/gpl.html
22 *
23 * @since 1.21
24 *
25 * @file
26 * @ingroup Site
27 *
28 * @license GNU GPL v2+
29 * @author Jeroen De Dauw < jeroendedauw@gmail.com >
30 */
31 class SiteSQLStore extends CachingSiteStore {
32
33 /**
34 * @since 1.21
35 * @deprecated 1.25 Construct a SiteStore instance directly instead.
36 *
37 * @param null $sitesTable Unused
38 * @param BagOStuff|null $cache
39 *
40 * @return SiteStore
41 */
42 public static function newInstance( $sitesTable = null, BagOStuff $cache = null ) {
43 if ( $sitesTable !== null ) {
44 throw new InvalidArgumentException(
45 __METHOD__ . ': $sitesTable parameter is unused and must be null'
46 );
47 }
48
49 if ( $cache === null ) {
50 $cache = wfGetCache( wfIsHHVM() ? CACHE_ACCEL : CACHE_ANYTHING );
51 }
52
53 $siteStore = new DBSiteStore();
54
55 return new static( $siteStore, $cache );
56 }
57
58 }