SiteSQLStore.php 1.9 KB

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