ApiQueryDisabled.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. /*
  3. * Created on Sep 25, 2008
  4. * API for MediaWiki 1.8+
  5. *
  6. * Copyright (C) 2008 Roan Kattouw <Firstname>.<Lastname>@home.nl
  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. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21. * http://www.gnu.org/copyleft/gpl.html
  22. */
  23. if (!defined('MEDIAWIKI')) {
  24. // Eclipse helper - will be ignored in production
  25. require_once ("ApiBase.php");
  26. }
  27. /**
  28. * API module that does nothing
  29. *
  30. * Use this to disable core modules with e.g.
  31. * $wgAPIPropModules['modulename'] = 'ApiQueryDisabled';
  32. *
  33. * To disable top-level modules, use ApiDisabled instead
  34. *
  35. * @ingroup API
  36. */
  37. class ApiQueryDisabled extends ApiQueryBase {
  38. public function __construct($main, $action) {
  39. parent :: __construct($main, $action);
  40. }
  41. public function execute() {
  42. $this->setWarning("The ``{$this->getModuleName()}'' module has been disabled.");
  43. }
  44. public function getAllowedParams() {
  45. return array ();
  46. }
  47. public function getParamDescription() {
  48. return array ();
  49. }
  50. public function getDescription() {
  51. return array(
  52. 'This module has been disabled.'
  53. );
  54. }
  55. protected function getExamples() {
  56. return array ();
  57. }
  58. public function getVersion() {
  59. return __CLASS__ . ': $Id: ApiQueryDisabled.php 41268 2008-09-25 20:50:50Z catrope $';
  60. }
  61. }