-
-
Notifications
You must be signed in to change notification settings - Fork 436
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
Fixed autoloader patch to work with composer-installed setup #3226
Conversation
isnt't there a way to say "require dirname(DIR) . etc etc OR require DIR . etc etc", to keep it some sort of one liner? |
Maybe... I try to stick with common stuff that everyone can easily read, though. If it takes more than a few seconds to come up with it will probably be confusing to some readers. :) |
the thing with require that it triggers an error otherwise it would be super easy to read: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
briefly tested
This patch seems to crash my site (non-composer install) |
Even the non-composer install should normally have the vendor folder. What's the error you're getting? |
i believe it was a open basedir restriction - trying to load vendor dir outside public_html instead of in public_html. |
@elidrissidev it was open basedir restriction for did a dirty fix of the composer patch in (It however still doesn't seem to load things like
|
@m-overlund ahh got it. You could also avoid the issue by setting @fballiano @colinmollenhour What do you think if the two lines were swapped instead, since most installs will likely have $autoloaderPath = getenv('COMPOSER_VENDOR_PATH');
if (!$autoloaderPath) {
- $autoloaderPath = dirname(BP) . DS . 'vendor';
+ $autoloaderPath = BP . DS . 'vendor';
if (!is_dir($autoloaderPath)) {
- $autoloaderPath = BP . DS . 'vendor';
+ $autoloaderPath = dirname(BP) . DS . 'vendor';
}
} |
@elidrissidev I think it was done this way for some reason but I can recall it from top of my head now |
Thanks - that was a better solution. Maybe it should be added to htaccess (commented out) |
Creating a variable for Nginx webserver must also be provided. You can push a PR that includes the modification in .htaccess and a paragraph in the README file. |
No objection. I think the motivation was to prevent an attacker from creating a vendor directory in the root which overrides the one in the parent directory, but I think if that prevents people from using |
I don't believe it will be necessary if switching the lines ends up being implemented, like @colinmollenhour suggests. |
As per #3216 this adds back the automatic detection of vendor in the parent directory of BP.