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
Asset library fails to resolve file system path correctly #4863
Comments
It is possible to work around this issue by making the path a valid path, but it's not perfect or git friendly: Create a symlink to the symlink inside the document root folder (
|
Outside of manually configuring this I don't know that it can be fixed properly? The symlinking looks a little funky. We, for example, use ~/home/USER/ for pyro install and rm public_html and then symlink it back to public (you can also simply rename public to public_html). And that works great. But you're on different levels here it looks like. git init - git remote add origin YOUR REPO - git pull Is a good way to pull down into a directory that already has CGI and other stuff in it that comes with a lot of hosting environments. |
The symlinking is simple /home/USER/some/path/pyro1/public => /home/USER/public_html/pyro1 Nevertheless, the problem I think is really that the Asset library assumes that a web path is always the same as the file path (which is not true), when it needs to read the content of file. You can clearly see from the error, that it mixes the file system path + the web path /home/USER/some/path/pyro1/public/some/web/path/pyro1/app/default/assets/public/theme.css Did you see my PR ? |
Fixed in Streams Platform 1.7 |
I can confirm it works Tested on a fresh installation of PyroCMS 3.7 branch |
Description
I'm trying to create a copy of an existing PyroCMS website for testing/development purpose, in a Apache/mod_userdir environment, where every employee has a personal web directory.
But the Asset library fails to resolve the correct file system path, when trying to get the content of files.
It seems that the Asset library assumes that file system paths and web paths are always the same, because it prepends the web base path:
/~<username>/<pyrocms>
to the relative pathapp/<app name>/assets/public/theme.css
before trying to get the content of the file.If I modify the
Asset::path
method, so the request base path is not prepended, the issue i'm having in this case with theAsset::inline
method goes away, but that seems to have a negative effect on methods likeAsset::script
To Reproduce
/home/<username>/public_html
is the "document root" and is available underhttp://<server>/~<username>
PyroCMS is placed outside the public_html directory
/home/<username>/src/<pyrocms>
and/home/<username>/src/<pyrocms>/public
is symlinked to/home/<username>/public_html/<pyrocms>
So it's available under
http://<server>/~<username>/<pyrocms>
The text was updated successfully, but these errors were encountered: