00001 <?php 00002 00003 /* 00004 * Created on Oct 22, 2006 00005 * 00006 * API for MediaWiki 1.8+ 00007 * 00008 * Copyright (C) 2008 Roan Kattouw <Firstname>.<Lastname>@home.nl 00009 * 00010 * This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License along 00021 * with this program; if not, write to the Free Software Foundation, Inc., 00022 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00023 * http://www.gnu.org/copyleft/gpl.html 00024 */ 00025 00026 if ( !defined( 'MEDIAWIKI' ) ) { 00027 // Eclipse helper - will be ignored in production 00028 require_once ( 'ApiFormatBase.php' ); 00029 } 00030 00034 class ApiFormatDbg extends ApiFormatBase { 00035 00036 public function __construct( $main, $format ) { 00037 parent :: __construct( $main, $format ); 00038 } 00039 00040 public function getMimeType() { 00041 // This looks like it should be text/plain, but IE7 is so 00042 // brain-damaged it tries to parse text/plain as HTML if it 00043 // contains HTML tags. Using MIME text/text works around this bug 00044 return 'text/text'; 00045 } 00046 00047 public function execute() { 00048 $this->printText( var_export( $this->getResultData(), true ) ); 00049 } 00050 00051 public function getDescription() { 00052 return 'Output data in PHP\'s var_export() format' . parent :: getDescription(); 00053 } 00054 00055 public function getVersion() { 00056 return __CLASS__ . ': $Id: ApiFormatDbg.php 61444 2010-01-23 22:52:40Z reedy $'; 00057 } 00058 }