Skip to content

Switched from getUri() to getRequestTarget() #9

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

Closed
wants to merge 1 commit into from
Closed

Switched from getUri() to getRequestTarget() #9

wants to merge 1 commit into from

Conversation

demaggus83
Copy link

Slim3 does weird stuff with their Http/Uri.php implementation. The normal "getPath()" will not return the expected path, at least if you run the embedded php webserver with a routerscript (Didn´t tried Apache or nginx). They use a "getBasePath()" method and this will return the correct path. This results in not matching any "files" and this in not loading the deps for the DebugBar.

So, to relay on getRequestTarget() should be an easy and framework independently fix.

Example:

$app = new \Slim\App();

$debugbar = new DebugBar\StandardDebugBar();
$debugbarRenderer = $debugbar->getJavascriptRenderer('/phpdebugbar');
$middleware = new PhpMiddleware\PhpDebugBar\PhpDebugBarMiddleware($debugbarRenderer);
$app->add($middleware);

$app->get('/', function ($request, $response, $args) {
    $response->getBody()->write(' Hello ');

    return $response;
});

$app->run();

Start the embedded php server with a router script
php -S 0.0.0.0:8080 -t public/ public/index.php

@snapshotpl
Copy link
Member

I need some tests to be sure that's not break anything

@demaggus83 demaggus83 closed this Jun 1, 2016
@demaggus83
Copy link
Author

Then feel free to write some tests and try?

@snapshotpl
Copy link
Member

But issue is still here, right?

@snapshotpl snapshotpl reopened this Jun 1, 2016
@demaggus83
Copy link
Author

Yep

@snapshotpl
Copy link
Member

@stahlstift Can you try #12 ?

@snapshotpl
Copy link
Member

Fixed in #12

@snapshotpl snapshotpl closed this Nov 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants