diff --git a/lib/Request.php b/lib/Request.php index 04c8d74..0027568 100644 --- a/lib/Request.php +++ b/lib/Request.php @@ -4,6 +4,7 @@ public static $strScriptPath; public static $strResourcePath; public static $varArgs; + public static $varPathParts; public static function process() { @@ -27,6 +28,9 @@ $strPath = preg_replace("/^\//", "", $strPath); $strPath = preg_replace("/\/$/", "", $strPath); + // Support for index arguments: + Request::$varPathParts = explode("/", $strPath); + // /test/action/a/b/c $fncIsFile = function($strScriptPath) @@ -73,6 +77,8 @@ array_shift($varArgs); + error_log($strParam); + Request::$varArgs = $varArgs; Request::$strResourcePath = $strPath; } @@ -87,6 +93,11 @@ return Request::$varArgs; } + public static function getPathParts() + { + return Request::$varPathParts; + } + // Safely returns a request argument by its index or null if it doesn't exist (without error) public static function getArg($intIndex) { diff --git a/php-webapp-framework.sh b/php-webapp-framework.sh index 1eee669..ebb9db8 100644 --- a/php-webapp-framework.sh +++ b/php-webapp-framework.sh @@ -1,3 +1,3 @@ #!/bin/bash -php -S 0.0.0.0:8080 index.php +php -S 0.0.0.0:8080 index.php --enable-mbstring