diff options
author | RaindropsSys <contact@minteck.org> | 2023-04-02 23:03:02 +0200 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-04-02 23:03:02 +0200 |
commit | 02eda3e4c9b4ba718f1fff70b7328ed8cdd5e63b (patch) | |
tree | 6d1dec61008998aadc6b69f7e750712794d99324 /app.php | |
parent | f559308a1b42a9036135d764374a8c007b7d70a9 (diff) | |
download | pluralconnect-02eda3e4c9b4ba718f1fff70b7328ed8cdd5e63b.tar.gz pluralconnect-02eda3e4c9b4ba718f1fff70b7328ed8cdd5e63b.tar.bz2 pluralconnect-02eda3e4c9b4ba718f1fff70b7328ed8cdd5e63b.zip |
Updated 35 files, added 11 files and deleted includes/components/search.inc (automated)
Diffstat (limited to 'app.php')
-rw-r--r-- | app.php | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -1,12 +1,21 @@ <?php -ob_start(); +$start = microtime(true); +$GLOBALS["ColdHazeStart"] = microtime(true); +$GLOBALS["ColdHazePerformance"] = []; + +if (!function_exists("formatPonypush")) { + function formatPonypush($message) { + return "Update to Ponypush 3.1.0 or later — (\$PA1$\$" . base64_encode($message) . "\$\$)"; + } +} require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/language.inc"; global $lang; global $pages; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/session.inc"; global $isLoggedIn; global $isLowerLoggedIn; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/functions.inc"; -$app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true); +global $app; +$app = $GLOBALS["ColdHazeApp"] = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true); if (str_ends_with($_GET['_'], "/")) { $pagename = substr($_GET['_'], 0, strlen($_GET['_']) - 1); @@ -25,6 +34,7 @@ if (in_array($toplevel, ["editor", "icons", "species", "uploads"])) { } } elseif ($toplevel === "") { $pageFile = $_SERVER['DOCUMENT_ROOT'] . "/pages/home.inc"; + $GLOBALS["ColdHazePerformance"]["router"] = (microtime(true) - $start) * 1000; require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/home.inc"; } else { if ($toplevel === "-") { @@ -33,6 +43,7 @@ if (in_array($toplevel, ["editor", "icons", "species", "uploads"])) { if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc")) { $pageFile = $_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc"; + $GLOBALS["ColdHazePerformance"]["router"] = (microtime(true) - $start) * 1000; require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc"; } else { peh_error("Page not found: " . strip_tags($pagename), 404); @@ -40,6 +51,7 @@ if (in_array($toplevel, ["editor", "icons", "species", "uploads"])) { } else if ($toplevel === "api") { if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc")) { $pageFile = $_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc"; + $GLOBALS["ColdHazePerformance"]["router"] = (microtime(true) - $start) * 1000; require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc"; } } else if ($toplevel === "cloudburst" || $toplevel === "raindrops" || (($isLoggedIn || $isLowerLoggedIn) && $toplevel === $app["other"]["slug"])) { @@ -60,6 +72,7 @@ if (in_array($toplevel, ["editor", "icons", "species", "uploads"])) { } $pageFile = $_SERVER['DOCUMENT_ROOT'] . "/pages/page.inc"; + $GLOBALS["ColdHazePerformance"]["router"] = (microtime(true) - $start) * 1000; require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/page.inc"; } else { if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/pages/" . $toplevel . ".inc")) { @@ -81,10 +94,12 @@ if (in_array($toplevel, ["editor", "icons", "species", "uploads"])) { if ((in_array($toplevel, $namesCloudburst) || in_array($toplevel, $namesRaindrops) || in_array($toplevel, $namesOther)) && $toplevel !== "unknown") { $pageFile = $_SERVER['DOCUMENT_ROOT'] . "/pages/page.inc"; + $GLOBALS["ColdHazePerformance"]["router"] = (microtime(true) - $start) * 1000; require_once $_SERVER['DOCUMENT_ROOT'] . "/pages/page.inc"; } else { global $toplevel; $pageFile = $_SERVER['DOCUMENT_ROOT'] . "/includes/util/short.inc"; + $GLOBALS["ColdHazePerformance"]["router"] = (microtime(true) - $start) * 1000; require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/util/short.inc"; } } |