X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Fapi%2FApiFormatYaml.php;h=8521db163b4aa8922273af5c89910dc56577437f;hb=958a998611ee5a4230a316be987a26947824195f;hp=40b8375c931cd2247a5e41ce51f1079c246840a7;hpb=5c1ca0fc833201ab78ebef8a4140d1f53b8fbfbf;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiFormatYaml.php b/includes/api/ApiFormatYaml.php index 40b8375c93..8521db163b 100644 --- a/includes/api/ApiFormatYaml.php +++ b/includes/api/ApiFormatYaml.php @@ -1,12 +1,11 @@ + * Copyright © 2006 Yuri Astrakhan @gmail.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,19 +19,23 @@ * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * http://www.gnu.org/copyleft/gpl.html */ -if (!defined('MEDIAWIKI')) { +if ( !defined( 'MEDIAWIKI' ) ) { // Eclipse helper - will be ignored in production - require_once ("ApiFormatBase.php"); + require_once( 'ApiFormatBase.php' ); } +/** + * API YAML output formatter + * @ingroup API + */ class ApiFormatYaml extends ApiFormatBase { - public function __construct($main, $format) { - parent :: __construct($main, $format); + public function __construct( $main, $format ) { + parent::__construct( $main, $format ); } public function getMimeType() { @@ -40,12 +43,14 @@ class ApiFormatYaml extends ApiFormatBase { } public function execute() { - require ('ApiFormatYaml_spyc.php'); - $this->printText(Spyc :: YAMLDump($this->getResult()->getData())); + $this->printText( Spyc::YAMLDump( $this->getResultData() ) ); + } + + public function getDescription() { + return 'Output data in YAML format' . parent::getDescription(); } - protected function getDescription() { - return 'Output data in YAML format'; + public function getVersion() { + return __CLASS__ . ': $Id$'; } } -?> \ No newline at end of file