-
-
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
Reverted autoloader patch #2791
Conversation
please add more context here |
@tmotyl These lines are added by |
Since a lot of third-party code was removed from the repository, why not add this back? If I'm understanding it right, all the installation methods need composer autoloader now. Even the release builder is bundling the |
@elidrissidev i think its required when you have a custom vendor path ... |
The code already checks the file in root folder and one level above (assuming you installed OM with composer and set the installation path to |
No time to test it now ... ... when i set
Will review later. |
Yeah I know but what are the odds, almost all PHP projects use "vendor" as folder name. |
I know its annoying to not-commit everytime ... but do we realy need to change it? |
I raised this same question before and the problem was with the custom vendor. it's not that annoying not to commit it, but the problem is that it can get commited by mistake and if it's a big commit it may go unnoticed. I would prefer to have it in the repo so that I wouldn't need to waste any second to check before commit. If the composer-plugin would rewrite the patch at every install it would solve our problem. |
there are ways to make this change ignored by git, might be useful during development on OpenMage, as long as one doesnt need to change this specific file. also, as we now require some parts as composer dependencies and the release builds contain composer installed modules anyway, it probably does not make a difference anymore if its added or not. |
@Flyingmana would it be possible for the composer plugin to just rewrite the patch at every install instead of just checkin if the file it's already patched? |
should not be hard to do https://github.com/Cotya/magento-composer-installer/blob/main/src/MagentoHackathon/Composer/Magento/Patcher/Bootstrap.php#L127 might do it somewhen during the week and likely extend the config so its configurable which patch behavior is used. |
Could we push the patch to |
I've found that with this removed it is a hassle for example if I create a clean install and then use "git stash" now my store is broken and I have to run composer again.. Just having it always present seems a whole lot simpler. If the only objection is that someone might have a different vendor folder name, does anyone actually know of any Magento users who did that, and was there a legitimate reason for it? |
it happened maaany time that we (mosly me actually hehehe) committed that patch by mistake, it makes our life very difficult. maybe there was also somebody with a vendor folder outside the document root? I don't remember. I'll create a PR to introduce it and let's see what happens there? |
@elidrissidev what if we add it in the default place and if somebody really needs they can add their own version to app/etc/includes? |
One possibility would be to introduce an environment variable like "COMPOSER_VENDOR_PATH" so it could be changed that way while the default would be to assume the BP. /** AUTOLOADER PATCH **/
if (file_exists($autoloaderPath = (getenv('COMPOSER_VENDOR_PATH') ?: BP) . DS . 'vendor/autoload.php')) {
require_once $autoloaderPath;
}
/** AUTOLOADER PATCH **/ |
I think it would have to be /** AUTOLOADER PATCH **/
if (file_exists($autoloaderPath = (getenv('COMPOSER_VENDOR_PATH') ?: BP . DS . 'vendor') . DS . 'autoload.php')) {
require_once $autoloaderPath;
}
/** AUTOLOADER PATCH **/ because the |
Isnt |
Yes, but when doing development on the core code after you clone the git repo and run the installation, now if you want to commit changes or do a |
Description (*)
Related Pull Requests
Contribution checklist (*)