romantomchak / magento-composer-autoload
Integration composer autoload into Magento. Allows to load third-party libraries from vendor directory.
Installs: 18 904
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 2
Open Issues: 0
Type:magento-module
Requires
- php: >=5.3.0
- composer/composer: ~1.0
Suggests
- magento-hackathon/magento-composer-installer: Magento extension installer
This package is auto-updated.
Last update: 2024-10-29 04:53:00 UTC
README
Complete and simple to install Composer autoloader to Magento.
NOTE. Version 1.1 is only compatible with Magento 1.9 CE and Magento 1.14 EE
Installation
Using magento-composer-installer
To install this autoload using magento-composer-installer you need to follow these steps:
- Create
composer.json
file (if it is not created already) and add extra parameters:
magento-root-dir
- Magento document root Path to Magento root directory regarding tocomposer.json
file.with-bootstrap-patch
- Prevent patching theMage.php
file.
For example, if your composer.json
file is in Magento root directory, then the extra configuration should look like this:
"extra": { "magento-root-dir": ".", "with-bootstrap-patch": false }
- Add
magento-composer-installer
andmagento-composer-installer
to composer requirements:
composer require magento-hackathon/magento-composer-installer composer require romantomchak/magento-composer-autoload
Manual install
If you want to install composer autoload manually (without using magento-composer-installer), you only need to copy the Autoload.php
file from this repository to app/code/community/Varien
directory in your Magento installation.
Configuration
This extension trying to locate the native composer autoloader which is located in vendor
directory. The vendor
directory may be in Magento root directory or Magento lib directory.
If you use the custom vendor directory, you need to specify the path to it by selecting one of two ways:
- define
MAGE_VENDOR_ROOT
php constant with full path to thevendor
directory (without a slash at the end) - set
MAGE_VENDOR_ROOT
environment variable with full path to thevendor
directory (without a slash at the end)
Also you can specify the custom name
for vendor directory by:
- define
MAGE_VENDOR_DIR_NAME
php constant withvendor
directory name - set
MAGE_VENDOR_DIR_NAME
environment variable withvendor
directory name