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

automatic vendor path detection with composer-installer #4

Open
davidverholen opened this issue Jan 13, 2015 · 1 comment
Open

automatic vendor path detection with composer-installer #4

davidverholen opened this issue Jan 13, 2015 · 1 comment

Comments

@davidverholen
Copy link

taken from magento2 functionality:

if the magento composer installer would add a file which returns the vendor path
(app/etc/vendor_path.php in magento2)
this module could add the composer autoloader automatically.

It would have to require (or maybe suggest) the magento composer installer in a version which supports this)

@barryvdh
Copy link

Looks like an interesting idea, shouldn't be too hard to implement here.

protected function getComposerVendorPath(){
    $baseDir = Mage::getBaseDir();

    if (file_exists($baseDir .'/app/etc/vendor_path.php')) {
        $vendorDir = require $baseDir .'/app/etc/vendor_path.php';
        return "{$baseDir}/{$vendorDir}";
    } else {
        $node = Mage::getConfig()->getNode(self::CONFIG_PATH_COMPOSER_VENDOR_PATH);
        $path = str_replace( '{{root_dir}}', $baseDir, $node);
        return $path;
    }
}

It probably doesn't matter much, but it does make it easier to write the path to a file.

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

2 participants