aboutsummaryrefslogtreecommitdiff
path: root/lib/response/textresponse.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2015-03-17 22:03:39 +0100
committerChristian Weiske <cweiske@cweiske.de>2015-03-17 22:03:39 +0100
commita375467d42cb53599ffddbd1d7ce8fae028972f8 (patch)
tree806da86795775a9e889c70fc4283dc5d7b76ab78 /lib/response/textresponse.php
parent81554f1309cc6a80578100b9583a591012df0d43 (diff)
downloadgrauphel-a375467d42cb53599ffddbd1d7ce8fae028972f8.tar.gz
grauphel-a375467d42cb53599ffddbd1d7ce8fae028972f8.zip
reStructuredText output
Diffstat (limited to 'lib/response/textresponse.php')
-rw-r--r--lib/response/textresponse.php43
1 files changed, 43 insertions, 0 deletions
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 @@
+<?php
+/**
+ * Part of grauphel
+ *
+ * PHP version 5
+ *
+ * @category Tools
+ * @package Grauphel
+ * @author Christian Weiske <cweiske@cweiske.de>
+ * @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 <cweiske@cweiske.de>
+ * @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;
+ }
+}
+?>