-
Notifications
You must be signed in to change notification settings - Fork 290
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
Allow for the use of PATH_INFO #196
base: master
Are you sure you want to change the base?
Conversation
This allows for the Apache server variable, PATH_INFO to be used.
Inline conditionals are not allowed
+1 |
This is a great idea! Either way, could you write a test mocking that server variable to verify that this works? |
if (!$p) { | ||
$p = $this->server->get('REQUEST_URI', '/'); | ||
} | ||
return $p; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, a few things here:
- You should use a variable name that has meaning, it makes it easier to read. Maybe
$uri
. - The conditional should be a bit more explicit, it should check for
!empty($uri)
- You should have new-line separation wrapping the block, so one before the if and after the closing brace
+1, and I'll be happy to take a look in a week or two. Until then, I'm using this hack: $req->server()->set('REQUEST_URI', $req->server()->get('PATH_INFO')); |
may you see my work: #346 I hope that will help you.. thank's |
This allows for the Apache server variable, PATH_INFO to be used.
It's a small edit, but it allows for Klein to work properly in a subdirectory