n98-magerun
n98-magerun copied to clipboard
composer vendor autoloads
in case if there is vendors extensions under magento root it will be good to have them inlcuded to autolad process. can you add automatic include for {magento_root}/vendor/autoload.php please
Thanks. I must check this, because you can run n98-magerun from source installed by composer. In this case the vendor/autoload.php in Magento root is already used. The other normal use case that n98-magerun runs in phar mode. In this case we have our own vendor folder inside the phar package with an own composer autoaloader. I don't know if we can combine multiple composer autoloaders.
multiple composer autoloaders are not a problem as the generated autoloader class gets a unique prefix which has avoiding such conflicts as side effect.
I would also like to have a config in the magerun config file which can point to other autoload files (I tend to have the vendor directory one directory level above)
In the meantime we have support for this use-case.
There is a \N98\Magento\Application\AutoloaderDecorator
in the Magerun core which tries to load a class from Magerun vendor folder. If that class is not loadable it tries as fallback to load with the Magento autoloader.
I close this issue. If this is still not helping in your case, please re-open the issue.