Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for Dynamic Request URI / Allow PATH_INFO Environment #346

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions src/Klein/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ class Request
*/
protected $body;


/**
* Request uri Environment for Dynamic Routing
*/
protected $uri = "REQUEST_URI";
/**
* Methods
*/
Expand Down Expand Up @@ -392,15 +395,26 @@ public function userAgent()
{
return $this->headers->get('USER_AGENT');
}


/**
* Set the request URI
*
* @return string
*/
public function seturi($uri)
{
$this->uri = $uri ;
return $this;
}

/**
* Gets the request URI
*
* @return string
*/
public function uri()
{
return $this->server->get('REQUEST_URI', '/');
return $this->server->get($this->uri, '/');
}

/**
Expand Down