00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 if (!defined('MEDIAWIKI')) {
00027
00028 require_once ('ApiFormatBase.php');
00029 }
00030
00034 class ApiFormatTxt 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(print_r($this->getResultData(), true));
00049 }
00050
00051 public function getDescription() {
00052 return 'Output data in PHP\'s print_r() format' . parent :: getDescription();
00053 }
00054
00055 public function getVersion() {
00056 return __CLASS__ . ': $Id: ApiFormatTxt.php 35098 2008-05-20 17:13:28Z ialex $';
00057 }
00058 }