Broken default sandbox path when not at the domain root #35

Closed
stof opened this Issue Jul 5, 2012 · 2 comments

Comments

Projects
None yet
3 participants
Contributor

stof commented Jul 5, 2012

When the application is not at the root of the domain, the path used by the sandbox is wrong. And as the path is a DIC parameter, it is impossible to provide a setup using the current request to determine the base path as it would require knowing the base path when building the container. So the default value is simply broken.

Contributor

ckdarby commented Sep 16, 2013

@stof Unable to reproduce that or I am misunderstanding.

I'm currently using Nelmio in /api/ instead of / and the sandbox functionality works fine.

Contributor

stof commented Sep 16, 2013

@ckdarby I'm not talking about putting the api depper than the root of the app. I'm talking about putting the root of the app deeper than the domain root, for instance http://localhost/test_app/web/ to access the / path in the app.
When using the Request object, this can be determined as $request->getBaseUrl() (or $request->getBasePath() to access assets which should not go through app.php. they might be different when you don't have mod_rewrite) but the DIC parameter cannot be set according to the request

@willdurand willdurand closed this Oct 27, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment