Merge "Added a separate error message for mkdir failures"
[lhc/web/wiklou.git] / includes / site / SiteSQLStore.php
index e61179b..2f8a113 100644 (file)
@@ -1,9 +1,7 @@
 <?php
 
 /**
- * Represents the site configuration of a wiki.
- * Holds a list of sites (ie SiteList) and takes care
- * of retrieving and caching site information when appropriate.
+ * Dummy class for accessing the global SiteStore instance.
  *
  * 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
  * @ingroup Site
  *
  * @license GNU GPL v2+
- * @author Jeroen De Dauw < jeroendedauw@gmail.com >
+ * @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 null $sitesTable Unused
-        * @param BagOStuff|null $cache
+        * @param null $sitesTable IGNORED
+        * @param null $cache IGNORED
         *
         * @return SiteStore
         */
@@ -46,13 +50,11 @@ class SiteSQLStore extends CachingSiteStore {
                        );
                }
 
-               if ( $cache === null ) {
-                       $cache = wfGetCache( wfIsHHVM() ? CACHE_ACCEL : CACHE_ANYTHING );
-               }
-
-               $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();
        }
 
 }