X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fapistatusnetversion.php;h=bc2babc3f2af743042d1aa6bece2d44cbf0455e0;hb=d8d9edfc990a20f67421e40a7d3055a58697a002;hp=471297ad55a151c1aa1b2337da4362f73407ad0f;hpb=62059fec832014411f604d9cc669b7d3201a60d5;p=quix0rs-gnu-social.git diff --git a/actions/apistatusnetversion.php b/actions/apistatusnetversion.php index 471297ad55..bc2babc3f2 100644 --- a/actions/apistatusnetversion.php +++ b/actions/apistatusnetversion.php @@ -21,6 +21,7 @@ * * @category API * @package StatusNet + * @author Evan Prodromou * @author Zach Copley * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 @@ -31,7 +32,7 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR . '/lib/twitterapi.php'; +require_once INSTALLDIR . '/lib/apiprivateauth.php'; /** * Returns a version number for this version of StatusNet, which @@ -41,15 +42,13 @@ require_once INSTALLDIR . '/lib/twitterapi.php'; * * @category API * @package StatusNet + * @author Evan Prodromou * @author Zach Copley * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ - -class ApiStatusnetVersionAction extends TwitterApiAction +class ApiStatusnetVersionAction extends ApiPrivateAuthAction { - var $format = null; - /** * Take arguments for running * @@ -58,11 +57,9 @@ class ApiStatusnetVersionAction extends TwitterApiAction * @return boolean success flag * */ - function prepare($args) { parent::prepare($args); - $this->format = $this->arg('format'); return true; } @@ -73,31 +70,43 @@ class ApiStatusnetVersionAction extends TwitterApiAction * * @return void */ - function handle($args) { parent::handle($args); switch ($this->format) { case 'xml': - $this->init_document('xml'); + $this->initDocument('xml'); $this->element('version', null, STATUSNET_VERSION); - $this->end_document('xml'); + $this->endDocument('xml'); break; case 'json': - $this->init_document('json'); + $this->initDocument('json'); print '"'.STATUSNET_VERSION.'"'; - $this->end_document('json'); + $this->endDocument('json'); break; default: $this->clientError( - _('API method not found!'), - 404, + // TRANS: Client error displayed when trying to handle an unknown API method. + _('API method not found.'), + 404, $this->format ); break; } } + /** + * Return true if read only. + * + * MAY override + * + * @param array $args other arguments + * + * @return boolean is read only action? + */ + function isReadOnly($args) + { + return true; + } } -