ApiDisabled.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 dies with an error immediately.
  29. *
  30. * Use this to disable core modules with
  31. * $wgAPIModules['modulename'] = 'ApiDisabled';
  32. *
  33. * To disable submodules of action=query, use ApiQueryDisabled instead
  34. *
  35. * @ingroup API
  36. */
  37. class ApiDisabled extends ApiBase {
  38. public function __construct($main, $action) {
  39. parent :: __construct($main, $action);
  40. }
  41. public function execute() {
  42. $this->dieUsage("The ``{$this->getModuleName()}'' module has been disabled.", 'moduledisabled');
  43. }
  44. public function isReadMode() {
  45. return false;
  46. }
  47. public function getAllowedParams() {
  48. return array ();
  49. }
  50. public function getParamDescription() {
  51. return array ();
  52. }
  53. public function getDescription() {
  54. return array(
  55. 'This module has been disabled.'
  56. );
  57. }
  58. protected function getExamples() {
  59. return array ();
  60. }
  61. public function getVersion() {
  62. return __CLASS__ . ': $Id: ApiDisabled.php 48091 2009-03-06 13:49:44Z catrope $';
  63. }
  64. }