Open gplanchat opened 10 years ago
thats a known problem with symlink and the magento core packages, a few core parts like this work with a path relative to the current file location.
Is there a fix for this? I am still getting problems with composer and magento 1 resulting in the following warning: "Warning: include_once(Varien/Autoload.php): failed to open stream: No such file or directory"
We usually recommend against symlinking core packages and build configs to make it possible to set this by package.
Is this happening because of a core package or some other?
Yes, its related to a core package: "Warning: include_once(Varien/Autoload.php): failed to open stream: No such file or directory in ..../vendor/connect20/Mage_Core_Modules/app/Mage.php on line 53"
How can i avoid the core package to be deployed using symlinks?
does this documentation help you? https://github.com/Cotya/magento-composer-installer/blob/master/doc/Deploy.md#overwrite-deploy-method-per-module
thanks. I already stumbled upon this repo. So the composer.json should look like this?
"extra": {
"magento-root-dir": "./",
"magento-force": true,
"magento-deploystrategy": "symlink",
"magento-deploystrategy-overwrite": {
"connect20/mage_core_modules": "copy"
}
}
But will all the symlinks in magento be overwritten with a file copy if i run composer update/install? I fear changing the deploy strategy afterwards will have no effect, won't it?
you will need to list the core modules one by one. Actually it would be better to instead use one of the core installers like https://github.com/AydinHassan/magento-core-composer-installer They are a lot better in solving issues specific to core packages.
Unfortunately the dependency of connect20/mage_core_modules
comes from another module. The list of requesters is long: https://packages.firegento.com/#!/mage_core_modules
Aydin hassan's module is already in my list, but i have no idea how to get rid of the magento_core_modules.
By the way, making Mage.php
a real file again by doing cp --remove-destination ../vendor/connect20/Mage_Core_Modules/app/Mage.php Mage.php
in app/
solves the issue. But seems to be more of a hack than a solution.
Edit:
I actually compared my required modules to all magento_core_modules
requests and found that only one extension, namely phoenix_moneybookers
depends on it. Luckily the extension is not essential, so i removed it and went for the recommended way:
composer require magento-hackathon/magento-composer-installer ~3.0
composer require aydin-hassan/magento-core-composer-installer ~1.2
composer require firegento/magento ~1.9.4.0
huh, I see, which exact packages do you have which depend on it?
You could introduce an own (mock) package, which replaces this dependency, I dont have the exact syntax on hand for his. But maybe this helps https://stackoverflow.com/questions/18882201/how-does-the-replace-property-work-with-composer
When using the symlink strategy, the updated
include_path
of Magento becomes :This is due to line 29 of the
app/Mage.php
file defining theBP
constant, as long as__FILE__
resolves to the realpath and not to the symlink path :