Skip to content

Invalid include path when using symlink strategy #141

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

Open
gplanchat opened this issue Nov 16, 2014 · 9 comments
Open

Invalid include path when using symlink strategy #141

gplanchat opened this issue Nov 16, 2014 · 9 comments

Comments

@gplanchat
Copy link

When using the symlink strategy, the updated include_pathof Magento becomes :

/var/www/releases/20141115141316/vendor/connect20/Mage_Core_Modules/app/code/local
/var/www/releases/20141115141316/vendor/connect20/Mage_Core_Modules/app/code/community
/var/www/releases/20141115141316/vendor/connect20/Mage_Core_Modules/app/code/core
/var/www/releases/20141115141316/vendor/connect20/Mage_Core_Modules/lib
.
/usr/share/php
/usr/share/pear

This is due to line 29 of the app/Mage.php file defining the BPconstant, as long as __FILE__resolves to the realpath and not to the symlink path :

define('BP', dirname(dirname(__FILE__)));
@Flyingmana
Copy link
Member

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.

@luxmedia
Copy link

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"

@Flyingmana
Copy link
Member

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?

@luxmedia
Copy link

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?

@Flyingmana
Copy link
Member

@luxmedia
Copy link

luxmedia commented Jan 25, 2019

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?

@Flyingmana
Copy link
Member

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.

@luxmedia
Copy link

luxmedia commented Jan 25, 2019

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

@Flyingmana
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants