GuzzleBundle icon indicating copy to clipboard operation
GuzzleBundle copied to clipboard

[CRITICAL] Assets can not be retrieved when site is not in domain root

Open SoboLAN opened this issue 9 years ago • 5 comments

First of all, I want to say that this bundle is really cool, I'm using it on a multitude of Symfony applications and it works great.

Recently I tried installing it on an application that does not live under a URL like http://domain.com/, but instead lives under a URL like http://domain.com/myapp/.

When installing the bundle, all the CSS, Javascript, image files etc. are copied in:

/public_html/myapp/web/bundles/playbloomguzzle

When you access the Profiler of myapp, the HTTP requests that should get the resources for this bundle look like this (example):

GET /bundles/playbloomguzzle/css/profiler.min.css

This however results in a HTTP 404 error (for all resources, not just the one specified above).

The correct URL should be:

GET /myapp/bundles/playbloomguzzle/css/profiler.min.css

Notice the myapp folder in the request. Since the application lives under http://domain.com/myapp/, that folder should appear in the request, but it doesn't.

Screenshot that shows the problem:

playbloom bug 404

Since the resources can not be retrieved, this is how the Guzzle tab looks like:

playbloom bug

So the information is there but... it's not really OK.


I don't how to solve this problem elegantly. Maybe determine the correct URL of the site and use that in the asset() call in the templates found in Resources/views/Profiler.

However I have no idea how to do that or if it's even possible, since I've never worked with Twig before.

Ideas ?


EDIT: This could be a Symfony bug ... some investigations necessary.

SoboLAN avatar Nov 24 '15 12:11 SoboLAN

Hey, this bundle is not actively maintained since Guzzle is now at version 6.

For your issue something is strange, because it relies on the asset()method in the twig view. I would dig into this asset method to check if everything behave properly ?

ludofleury avatar Nov 24 '15 13:11 ludofleury

OK so, if it won't be fixed, do you recommend another library that does the same thing ? Something that will work with PHP 5.3 and Guzzle 3.*

EDIT: I'll try this one, hopefully it will work :) .

SoboLAN avatar Nov 26 '15 08:11 SoboLAN

Well, it's just a path for about CSS and JS. You can actually try to fix it ? Check the views, check the assets() methods, figure what happened. If you find a fix, submit a PR. Otherwise I have no idea.

On Thu, 26 Nov 2015 at 09:02, Radu Murzea [email protected] wrote:

OK so, if it won't be fixed, do you recommend another library that does the same thing ? Something that will work with PHP 5.3 and Guzzle 3.*

— Reply to this email directly or view it on GitHub https://github.com/ludofleury/GuzzleBundle/issues/28#issuecomment-159841481 .

ludofleury avatar Nov 26 '15 09:11 ludofleury

Hey @ludofleury if this bundle, could you mark your package as abandoned on packagist and redirect to another bundle (misd, if speaking about guzzle 3) ?

We still have an issue with having tons of guzzle bundles available. See #9

csarrazi avatar Nov 26 '15 09:11 csarrazi

Well, I would like, see the PR 29 on MISD... This was a long long story back in the days. We all tried to merge into one bundle behind the official namespace. Open source life. On Thu, 26 Nov 2015 at 10:57, Charles Sarrazin [email protected] wrote:

Hey @ludofleury https://github.com/ludofleury if this bundle, could you mark your package as abandoned on packagist and redirect to another bundle (misd, if speaking about guzzle 3) ?

We still have an issue with having tons of guzzle bundles available. See #9 https://github.com/ludofleury/GuzzleBundle/issues/9

— Reply to this email directly or view it on GitHub https://github.com/ludofleury/GuzzleBundle/issues/28#issuecomment-159864384 .

ludofleury avatar Nov 26 '15 11:11 ludofleury