You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know you're not trying to make this everything to everybody - it's already quite fantastic as it stands. I fully understand if this is more than you'd want to include.
Description
The current setup always assumes klein is being using from the server's root. If I have multiple apps I want to serve independently of one another in various subdirectories, that assumption doesn't hold.
Solution Option 1
The code would be in the section that defines the $uri variable, right after the part where you trim off the query string
<?php
if ($appDir != '/' AND strpos($uri, $appDir) !== false) {
$uri = substr($uri, strlen($appDir));
}
?>
I can do a pull request for the code if you like, but I thought you would be best able to determine how a user can define their $appDir.
Solution Option 2
You could leave query string munging up to the user. They're responsible for stripping out their $appDir prefix and must always pass an explicit URI to dispatch().
However, then they would also need to know when or if to trim off the query string, or handle whatever other future cases you have in your portion of the URI code.
The text was updated successfully, but these errors were encountered:
I decided to leave this feature out. klein has no configuration so incorporating an app path wouldn't really fit with what I was going for. I'll push a new version tomorrow which trims off the query string for user specified URI's. It becomes trivial for users to implement this themselves:
I know you're not trying to make this everything to everybody - it's already quite fantastic as it stands. I fully understand if this is more than you'd want to include.
Description
The current setup always assumes klein is being using from the server's root. If I have multiple apps I want to serve independently of one another in various subdirectories, that assumption doesn't hold.
Solution Option 1
The code would be in the section that defines the
$uri
variable, right after the part where you trim off the query stringI can do a pull request for the code if you like, but I thought you would be best able to determine how a user can define their
$appDir
.Solution Option 2
You could leave query string munging up to the user. They're responsible for stripping out their
$appDir
prefix and must always pass an explicit URI todispatch()
.However, then they would also need to know when or if to trim off the query string, or handle whatever other future cases you have in your portion of the URI code.
The text was updated successfully, but these errors were encountered: