00001 <?php 00002 00003 /* 00004 * Created on Sep 19, 2006 00005 * 00006 * API for MediaWiki 1.8+ 00007 * 00008 * Copyright (C) 2006 Yuri Astrakhan <Firstname><Lastname>@gmail.com 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 ApiFormatYaml extends ApiFormatBase { 00035 00036 public function __construct( $main, $format ) { 00037 parent :: __construct( $main, $format ); 00038 } 00039 00040 public function getMimeType() { 00041 return 'application/yaml'; 00042 } 00043 00044 public function execute() { 00045 $this->printText( Spyc :: YAMLDump( $this->getResultData() ) ); 00046 } 00047 00048 public function getDescription() { 00049 return 'Output data in YAML format' . parent :: getDescription(); 00050 } 00051 00052 public function getVersion() { 00053 return __CLASS__ . ': $Id: ApiFormatYaml.php 60930 2010-01-11 15:55:52Z simetrical $'; 00054 } 00055 }