diff options
Diffstat (limited to 'Neutron-trunk/resources/private/relative.php')
-rw-r--r-- | Neutron-trunk/resources/private/relative.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Neutron-trunk/resources/private/relative.php b/Neutron-trunk/resources/private/relative.php new file mode 100644 index 0000000..d9156e6 --- /dev/null +++ b/Neutron-trunk/resources/private/relative.php @@ -0,0 +1,31 @@ +<?php
+
+function getRelativeDetails($source) {
+ global $__root;
+
+ $GLOBALS["ORIGINAL_DOCUMENT_ROOT"] = $_SERVER['DOCUMENT_ROOT'];
+
+ if (substr($_SERVER['REQUEST_URI'], 0, strlen($source) + 1) === "/" . $source) {
+ $__root = "";
+ $GLOBALS["SYSTEM_ROOT"] = "";
+ $GLOBALS["SYSTEM_PREFIXED"] = false;
+ } else {
+ $_SERVER['DOCUMENT_ROOT'] = $_SERVER['DOCUMENT_ROOT'] . "/" . explode("/", $_SERVER["PHP_SELF"])[1];
+ $__root = "/" . explode("/", $_SERVER["PHP_SELF"])[1];
+ $GLOBALS["SYSTEM_ROOT"] = "/" . explode("/", $_SERVER["PHP_SELF"])[1];
+ $GLOBALS["SYSTEM_PREFIXED"] = true;
+ }
+
+ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/oldRenderer") && $GLOBALS["SYSTEM_PREFIXED"]) {
+ header("Content-Type: text/plain");
+ echo("Error: Neutron Titanium does not support relative URLs! Please delete ./data/webcontent/oldRenderer and try again.");
+ require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit();
+ }
+
+ if (isset($__electrode) && $__electrode) {
+ $__root = "";
+ $GLOBALS["SYSTEM_ROOT"] = "";
+ $_SERVER['DOCUMENT_ROOT'] = $GLOBALS["ORIGINAL_DOCUMENT_ROOT"];
+ $GLOBALS["SYSTEM_PREFIXED"] = false;
+ }
+}
\ No newline at end of file |