reStructuredText output
[grauphel.git] / lib / response / xmlresponse.php
1 <?php
2 /**
3  * Part of grauphel
4  *
5  * PHP version 5
6  *
7  * @category  Tools
8  * @package   Grauphel
9  * @author    Christian Weiske <cweiske@cweiske.de>
10  * @copyright 2014 Christian Weiske
11  * @license   http://www.gnu.org/licenses/agpl.html GNU AGPL v3
12  * @link      http://cweiske.de/grauphel.htm
13  */
14 namespace OCA\Grauphel\Response;
15
16 /**
17  * Returns XML data
18  *
19  * @category  Tools
20  * @package   Grauphel
21  * @author    Christian Weiske <cweiske@cweiske.de>
22  * @copyright 2014 Christian Weiske
23  * @license   http://www.gnu.org/licenses/agpl.html GNU AGPL v3
24  * @version   Release: @package_version@
25  * @link      http://cweiske.de/grauphel.htm
26  */
27 class XmlResponse extends \OCP\AppFramework\Http\Response
28 {
29     protected $xml;
30
31     public function __construct($xml)
32     {
33         $this->setStatus(\OCP\AppFramework\Http::STATUS_OK);
34         $this->addHeader('Content-Type', 'text/xml; charset=utf-8');
35         $this->xml = $xml;
36     }
37
38     public function render()
39     {
40         return $this->xml;
41     }
42 }
43 ?>