aboutsummaryrefslogtreecommitdiff
path: root/Neutron-trunk/api/engine-cyclic/wrapper.php
diff options
context:
space:
mode:
Diffstat (limited to 'Neutron-trunk/api/engine-cyclic/wrapper.php')
-rw-r--r--Neutron-trunk/api/engine-cyclic/wrapper.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/Neutron-trunk/api/engine-cyclic/wrapper.php b/Neutron-trunk/api/engine-cyclic/wrapper.php
new file mode 100644
index 0000000..196060d
--- /dev/null
+++ b/Neutron-trunk/api/engine-cyclic/wrapper.php
@@ -0,0 +1,42 @@
+<?php
+
+function render(string $page) {
+ global $MPCMSRendererPageNameValue;
+
+ if ($page == "index") {
+ $MPCMSRendererPageNameValue = "index";
+ rlgps("Processing website homepage");
+ if (!cacheCheck("index")) {
+ require_once $_SERVER['DOCUMENT_ROOT'] . "/api/engine-cyclic/homepage.php";
+
+ $content = ob_get_contents();
+ file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/cache/page-index", $content);
+ require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/debug.php";debugDump();
+ } else {
+ rlgps("Received page from cache");
+ }
+ } else {
+ $MPCMSRendererPageNameValue = $page;
+ rlgps("Processing /{$page}");
+ if (!cacheCheck($page)) {
+ require_once $_SERVER['DOCUMENT_ROOT'] . "/api/engine-cyclic/pages.php";
+
+ $content = ob_get_contents();
+ file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/cache/page-" . $page, $content);
+ require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/debug.php";debugDump();
+ } else {
+ rlgps("Received page from cache");
+ }
+ }
+}
+
+function renderSpecial(string $markup, string $displayName = "Page") {
+ global $MPCMSRendererPageMarkup;
+ global $MPCMSRendererPageMarkupDN;
+
+ $MPCMSRendererPageMarkup = $markup;
+ $MPCMSRendererPageMarkupDN = $displayName;
+ rlgps("Processing special page");
+ require_once $_SERVER['DOCUMENT_ROOT'] . "/api/engine-cyclic/special.php";
+ require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/private/debug.php";debugDump();
+} \ No newline at end of file