From a375467d42cb53599ffddbd1d7ce8fae028972f8 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Tue, 17 Mar 2015 22:03:39 +0100 Subject: reStructuredText output --- lib/response/textresponse.php | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 lib/response/textresponse.php (limited to 'lib/response/textresponse.php') diff --git a/lib/response/textresponse.php b/lib/response/textresponse.php new file mode 100644 index 0000000..ba6bb70 --- /dev/null +++ b/lib/response/textresponse.php @@ -0,0 +1,43 @@ + + * @copyright 2014 Christian Weiske + * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3 + * @link http://cweiske.de/grauphel.htm + */ +namespace OCA\Grauphel\Response; + +/** + * Returns plain text + * + * @category Tools + * @package Grauphel + * @author Christian Weiske + * @copyright 2014 Christian Weiske + * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3 + * @version Release: @package_version@ + * @link http://cweiske.de/grauphel.htm + */ +class TextResponse extends \OCP\AppFramework\Http\Response +{ + protected $text; + + public function __construct($text) + { + $this->setStatus(\OCP\AppFramework\Http::STATUS_OK); + $this->addHeader('Content-Type', 'text/plain; charset=utf-8'); + $this->text = $text; + } + + public function render() + { + return $this->text; + } +} +?> -- cgit v1.2.3