aboutsummaryrefslogtreecommitdiff
path: root/App/XMLResponse.php
diff options
context:
space:
mode:
authorwinter Sparkles2026-08-08 23:01:51 +0100
committerwinter Sparkles2026-08-08 23:01:51 +0100
commitb422b6ded608807c7d3bb8b965b3797ca513610b (patch)
tree7925fa972efbfff2a9bf8648334d49e3fd6b5df1 /App/XMLResponse.php
parent880a274e1ecbed42c76d3dc4a81161b3ae372726 (diff)
implement a large chunk of the auth system itself :D
Diffstat (limited to 'App/XMLResponse.php')
-rw-r--r--App/XMLResponse.php44
1 files changed, 0 insertions, 44 deletions
diff --git a/App/XMLResponse.php b/App/XMLResponse.php
deleted file mode 100644
index bdbf44b..0000000
--- a/App/XMLResponse.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-namespace App;
-
-class XMLResponse {
- public \SimpleXMLElement $doc;
- private static array $stylesheets;
- private static array $runFirst;
-
- static function addStylesheet(string $path) {
- $sheet = \Dom\XMLDocument::createFromFile($path);
- self::$stylesheets[] = $sheet;
- }
-
- static function addPreamble(callable $preamble) {
- self::$runFirst[] = $preamble;
- }
-
- function __construct(string $rootElement = 'page') {
- $this->doc = new \SimpleXMLElement("<$rootElement/>");
- foreach (self::$runFirst as $fn) {
- $fn($this->doc);
- }
- }
-
- function sendRaw() {
- header('Content-Type: application/xml');
- echo $this->doc->asXML();
- }
-
- function send() {
- if (isset($_GET['RawXML'])) {
- $this->sendRaw();
- return;
- }
-
- //header('Content-Type: application/xhtml+xml');
- $processor = new \XSLTProcessor;
- foreach (self::$stylesheets as $sheet) {
- $processor->importStylesheet($sheet);
- }
- $root = \Dom\import_simplexml($this->doc);
- echo $processor->transformToXml($root);
- }
-}