Skip to content
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

symlink mappings #153

Open
davidverholen opened this issue Dec 20, 2014 · 8 comments
Open

symlink mappings #153

davidverholen opened this issue Dec 20, 2014 · 8 comments

Comments

@davidverholen
Copy link

Hey Daniel,

recently I found out that my Installer is not able to map the Danslo Api Import correctly.
bragento/bragento-composer-installer#17

His Mapping in the modman file is:
code app/code/local/Danslo/ApiImport/

The expected behavior for this file defined in the symlink Strategy is:
dir app/etc/ --> link app/etc/dir to dir

So this would be
app/code/local/Danslo/ApiImport/code to code

What apparently is wrong.

But, in the Hackathon Installer it's working. So that leaves 2 options, fix this and make the affected programmers change their mappings, or just change the expected behavior (which might be the much easier way).

I'm not quite sure about this since the expected behavior defined in the symlink strategy seems pretty much orientated at the basic Linux file operations, which seems to be the right way to do this.

@Flyingmana
Copy link
Member

how does the original modman behave in this case?

@davidverholen
Copy link
Author

it does map it right to app/code/local/Danslo/ApiImport to code
So it seems as if the expected behavior is wrong

@flancer64
Copy link

Hello,
I have tried to deploy Magento using "symlink" strategy and have found that a lot of code from method \MagentoHackathon\Composer\Magento\Installer\MagentoInstallerAbstract::getDeployStrategy is not used. The last method was called is \MagentoHackathon\Composer\Magento\Installer\CoreInstaller::getDeployStrategy:

    public function getDeployStrategy(PackageInterface $package, $strategy = null)
    {
        $deployStrategy = new Core($this->getSourceDir($package), $this->getTargetDir());
        $deployStrategy->setIgnoredMappings($this->getModuleSpecificDeployIgnores($package));
        return $deployStrategy;
    }

I have changed this code to:

    public function getDeployStrategy(PackageInterface $package, $strategy = null)
    {
        $deployStrategy = new Core($this->getSourceDir($package), $this->getTargetDir());
        $deployStrategy->setIgnoredMappings($this->getModuleSpecificDeployIgnores($package));
        $result = parent::getDeployStrategy($package, $deployStrategy);
        return $result;
    }

and now I can deploy Magento using "symlink" strategy.

@davidverholen
Copy link
Author

That was the desired behavior.

Currently, the Core is also deployed with the normal mappings mechanism. The mappings for the core are on the first directory level of the magento root dir.

If you deploy the magento core with symlink strategy and then install a module with symlink strategy, you will end up with nested symlinks which can break the installation.

@flancer64
Copy link

Thanks, David.
Currently "the normal mappings mechanism" for the Core ("magento/core" module) is a "copy" strategy. "Symlink" strategy will not be used for "magento/core" module anymore. Do I understand correctly?

Thanks again.

@davidverholen
Copy link
Author

yes, because when you symlink the core, there is for example one link from magentoroot/app pointing to vendor/magento/core/app.

If you now install a module, the symlink should be pointing from magentoroot/app/code/community/Company/Module to for example vendor/company/module/code

since magentoroot/app now points to vendor/magento/core/app, the symlink will be created at vendor/magento/core/app/code/community/Company/Module and it will be linked to ../../../../../vendor/company/module/code.

This will be a broken symlink because the directory structure in vendor differs from the directory structure in magento root.

I know it's even more difficult if your not that deep into this project ;) But, in short, it will create broken symlinks for magento modules in most cases

@flancer64
Copy link

OK, thanks David :)

Magento Composer is the great product (y)

@davidverholen
Copy link
Author

a way to fix this is to deploy everything on file level and don't symlink directories. I'm not sure if @Flyingmana has planned this now for the 3.0 release. I'm currently also trying to achieve that in another Project

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