[ConfigurationBuilder] Use Request#getBasePath() if desired target file exists, but fall back to Request#getBaseUrl() otherwise; that is, if the script needs to be generated by Assetic's controller.
If assetic.use_controller was enabled, ConfigurationBuilder unconditionally prepended the front controller script (i.e. app_dev.php/) to the base URL. This led to 404 errors when attempting to load, for example, /base/path/app_dev.php/path/to/file.js in a require() call. Scripts that are generated by Assetic need this behavior, but scripts that already exist in the web directory should be loaded directly without going through the Assetic controller.
@komputerwiz, I don't see the point in these changes. If you don't want to use the controller, switch off this option in your application configuration and make dump assets. In production URLs are correct.
If
assetic.use_controller
was enabled, ConfigurationBuilder unconditionally prepended the front controller script (i.e.app_dev.php/
) to the base URL. This led to 404 errors when attempting to load, for example,/base/path/app_dev.php/path/to/file.js
in arequire()
call. Scripts that are generated by Assetic need this behavior, but scripts that already exist in theweb
directory should be loaded directly without going through the Assetic controller.