]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blob - includes/api/ApiFormatDbg.php
MediaWiki 1.16.0
[autoinstalls/mediawiki.git] / includes / api / ApiFormatDbg.php
1 <?php
2
3 /*
4  * Created on Oct 22, 2006
5  *
6  * API for MediaWiki 1.8+
7  *
8  * Copyright (C) 2008 Roan Kattouw <Firstname>.<Lastname>@home.nl
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License along
21  * with this program; if not, write to the Free Software Foundation, Inc.,
22  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23  * http://www.gnu.org/copyleft/gpl.html
24  */
25
26 if ( !defined( 'MEDIAWIKI' ) ) {
27         // Eclipse helper - will be ignored in production
28         require_once ( 'ApiFormatBase.php' );
29 }
30
31 /**
32  * @ingroup API
33  */
34 class ApiFormatDbg extends ApiFormatBase {
35
36         public function __construct( $main, $format ) {
37                 parent :: __construct( $main, $format );
38         }
39
40         public function getMimeType() {
41                 // This looks like it should be text/plain, but IE7 is so
42                 // brain-damaged it tries to parse text/plain as HTML if it
43                 // contains HTML tags. Using MIME text/text works around this bug
44                 return 'text/text';
45         }
46
47         public function execute() {
48                 $this->printText( var_export( $this->getResultData(), true ) );
49         }
50
51         public function getDescription() {
52                 return 'Output data in PHP\'s var_export() format' . parent :: getDescription();
53         }
54
55         public function getVersion() {
56                 return __CLASS__ . ': $Id: ApiFormatDbg.php 61444 2010-01-23 22:52:40Z reedy $';
57         }
58 }