From cc5474ef80a084d78ebed4bb4762b0127f86685c Mon Sep 17 00:00:00 2001 From: Conner Harkness Date: Tue, 5 Aug 2025 08:27:49 -0600 Subject: [PATCH] Added getPath function --- index.php | 67 +++++++++++++++++++++++++++---------------------- lib/Request.php | 7 ++++++ 2 files changed, 44 insertions(+), 30 deletions(-) diff --git a/index.php b/index.php index 9552eb8..8f1e0ba 100644 --- a/index.php +++ b/index.php @@ -65,6 +65,9 @@ $varMimeTypes = array( array("/\.css$/", "text/css"), array("/\.js$/", "application/javascript"), + array("/\.png$/", "image/png"), + array("/\.jpg$/", "image/jpeg"), + array("/\.jpeg$/", "image/jpeg"), ); foreach ($varMimeTypes as $varMimeType) @@ -126,45 +129,49 @@ requireAll("init.php"); ?> + + - -
- -
+ +
+
+ +
-
- getMessage(); - echo $strMessage; - echo "\n\n"; +
+ getMessage(); + echo $strMessage; + echo "\n\n"; - $strFile = $x->getFile(); - $intLine = $x->getLine(); - - echo "#-1 {$strFile}({$intLine}): {$strMessage}\n"; - echo $x->getTraceAsString(); + $strFile = $x->getFile(); + $intLine = $x->getLine(); + + echo "#-1 {$strFile}({$intLine}): {$strMessage}\n"; + echo $x->getTraceAsString(); - ob_end_flush(); - exit; - } - ?> -
+ ob_end_flush(); + exit; + } + ?> +
- diff --git a/lib/Request.php b/lib/Request.php index 0027568..b794c2c 100644 --- a/lib/Request.php +++ b/lib/Request.php @@ -98,6 +98,13 @@ return Request::$varPathParts; } + public static function getPath() + { + $strPath = "/"; + $strPath .= implode("/", Request::getPathParts()); + return $strPath; + } + // Safely returns a request argument by its index or null if it doesn't exist (without error) public static function getArg($intIndex) {