X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FApp%2FArguments.php;h=4d386fc2551d2c5138e80db4e4fca53872fbcd7d;hb=f264923cad9b867771c793cc10af36689c1c657e;hp=19f8e9212310d8cef413d544a4e1b4d92adf44f9;hpb=5aad46c7fb2b66d63ad93d92ee355fc522b57be1;p=friendica.git diff --git a/src/App/Arguments.php b/src/App/Arguments.php index 19f8e92123..4d386fc255 100644 --- a/src/App/Arguments.php +++ b/src/App/Arguments.php @@ -1,6 +1,6 @@ queryString = $queryString; $this->command = $command; $this->moduleName = $moduleName; $this->argv = $argv; $this->argc = $argc; + $this->method = $method; } /** @@ -94,6 +99,14 @@ class Arguments return $this->argv; } + /** + * @return string The used HTTP method + */ + public function getMethod() + { + return $this->method; + } + /** * @return int The count of arguments of this call */ @@ -199,6 +212,8 @@ class Arguments $module = "login"; } - return new Arguments($queryString, $command, $module, $argv, $argc); + $httpMethod = in_array($server['REQUEST_METHOD'] ?? '', Router::ALLOWED_METHODS) ? $server['REQUEST_METHOD'] : Router::GET; + + return new Arguments($queryString, $command, $module, $argv, $argc, $httpMethod); } }