From 986791fea1fbba483daf0d19ed584dda28a64fbf Mon Sep 17 00:00:00 2001 From: XlXi Date: Sun, 13 Dec 2020 23:54:38 -0500 Subject: [PATCH] Add CDN and add API class --- WebAssemblies/API.php | 29 +++++++++++++++++++++++++++++ WebAssemblies/loader.php | 6 ++---- public/cdn/www/index.php | 14 ++++++++++++++ {root => public/www}/index.php | 4 ++-- 4 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 WebAssemblies/API.php create mode 100644 public/cdn/www/index.php rename {root => public/www}/index.php (65%) diff --git a/WebAssemblies/API.php b/WebAssemblies/API.php new file mode 100644 index 0000000..f6cefc8 --- /dev/null +++ b/WebAssemblies/API.php @@ -0,0 +1,29 @@ +"$message"])); + } + + function PrettyJSONEncode($array){ + return json_encode($array, JSON_PRETTY_PRINT); + } +} + +?> \ No newline at end of file diff --git a/WebAssemblies/loader.php b/WebAssemblies/loader.php index 143d55b..f1751ff 100644 --- a/WebAssemblies/loader.php +++ b/WebAssemblies/loader.php @@ -6,13 +6,11 @@ Platinus Backend Autoloader */ -$webAssemblies = $_SERVER["DOCUMENT_ROOT"] . "/../WebAssemblies/"; - function reqMod($mod) { - global $webAssemblies; - require $webAssemblies . $mod; + require $mod; } reqMod("Web.php"); +reqMod("API.php"); ?> \ No newline at end of file diff --git a/public/cdn/www/index.php b/public/cdn/www/index.php new file mode 100644 index 0000000..27dad3f --- /dev/null +++ b/public/cdn/www/index.php @@ -0,0 +1,14 @@ +InvokeError(403, "Unauthorized"); +?> \ No newline at end of file diff --git a/root/index.php b/public/www/index.php similarity index 65% rename from root/index.php rename to public/www/index.php index 29e3345..9df7f47 100644 --- a/root/index.php +++ b/public/www/index.php @@ -6,7 +6,7 @@ Platinus Home Page */ -require $_SERVER["DOCUMENT_ROOT"] . "/../WebAssemblies/loader.php"; +require $_SERVER["DOCUMENT_ROOT"] . "/../../WebAssemblies/loader.php"; $page = new Platinus\Web(); @@ -18,7 +18,7 @@ $headers = $page->buildHeaders(); ?>

Platinus

-

Yeah

+

Simple home page

buildPage($headers);