X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fsite%2FSiteSQLStore.php;h=91d9ef7c5ddba44b3ce66e22f9e861fb63475760;hb=e548e0f35c4b47a0de4903e8a3758c2b2d9e2712;hp=e3230fff84a7a589e1f5396c95555c06fdd07c5f;hpb=85f481a0dd58ec0bd3033685bc05b8f8baae4057;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/site/SiteSQLStore.php b/includes/site/SiteSQLStore.php index e3230fff84..91d9ef7c5d 100644 --- a/includes/site/SiteSQLStore.php +++ b/includes/site/SiteSQLStore.php @@ -1,9 +1,7 @@ + * @license GPL-2.0-or-later + * @author Daniel Kinzler */ -class SiteSQLStore extends CachingSiteStore { +class SiteSQLStore { /** + * Returns the global SiteStore instance. This is a relict of the first implementation + * of SiteStore, and is kept around for compatibility. + * + * @note This does not return an instance of SiteSQLStore! + * * @since 1.21 - * @deprecated 1.25 Construct a SiteStore instance directly instead. + * @deprecated since 1.27 use MediaWikiServices::getSiteStore() + * or MediaWikiServices::getSiteLookup() instead. * - * @param ORMTable|null $sitesTable - * @param BagOStuff|null $cache + * @param null $sitesTable IGNORED + * @param BagOStuff|null $cache IGNORED * * @return SiteStore */ - public static function newInstance( ORMTable $sitesTable = null, BagOStuff $cache = null ) { - if ( $cache === null ) { - $cache = wfGetCache( wfIsHHVM() ? CACHE_ACCEL : CACHE_ANYTHING ); + public static function newInstance( $sitesTable = null, BagOStuff $cache = null ) { + if ( $sitesTable !== null ) { + throw new InvalidArgumentException( + __METHOD__ . ': $sitesTable parameter is unused and must be null' + ); } - $siteStore = new DBSiteStore(); + // NOTE: we silently ignore $cache for now, since some existing callers + // specify it. If we break compatibility with them, we could just as + // well just remove this class. - return new static( $siteStore, $cache ); + return \MediaWiki\MediaWikiServices::getInstance()->getSiteStore(); } }