2017 © Pedro PelĂĄez
 

magento-module magento-composer-autoloader

image

mattwellss/magento-composer-autoloader

  • Thursday, January 7, 2016
  • by mattwellss
  • Repository
  • 2 Watchers
  • 6 Stars
  • 748 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 9 Versions
  • 8 % Grown

The README.md

Magento Composer Autoloader

Complete and simple to install Composer autoloader or Magento, (*1)

Why Does This Even Exist?

  1. Other Composer autoloader integrations aren't complete. The most common issues with other implementations:
    • They allow both Magento and Composer to register autoloaders. This causes problems when using libraries that expect class_exists to work properly—Magento's will always attempt to include the file.
    • They allow Magento's autoload to register itself, then manually de-register it. This is wholly unnecessary overhead.
    • They require manual configuration of composer.json for Magento autoloading.
  2. With more and more need to integrate namespaced systems with Magento, a require-able, redistributable, easy to set up module is needed

Installation

Until it's listed in packagist or firegento, add the repository to your composer.json:, (*2)

{
    "type": "vcs",
    "url": "https://github.com/mattwellss/magento-composer-autoloader"
}

Add the library to your require section:, (*3)

"require": {
    "mattwellss/magento-composer-autoloader": "~1.0"
}

Configuration

Post install, the new Varien_Autoload class needs to know where vendor/autoload.php is hiding. This must be configured., (*4)

Defining the vendor root directory

Regardless of how the vendor dir is defined, it must not end with a trailing slash., (*5)

The two methods of describing the vendor root directory are: - VENDOR_ROOT constant. Must be defined in all entry points. - MAGE_VENDOR_ROOT env variable. Be sure it's defined for all PHP environments (cli and fpm/mod_php)., (*6)

Optimizing the Autoloader

Normally, composer dump -o is all one does to optimize a composer autoloader. However, running php shell/classmap_generator.php when deploying new code to production is recommended. The script generates a classmap file to be used by composer to speed autoloading of files in Magento's code pools., (*7)

To enable use of the generated classmap, include define('OPTIMIZED_COMPOSER', true) in includes/config.php., (*8)

The Versions

07/01 2016

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

07/01 2016

1.0.2

1.0.2.0

  Sources   Download

MIT

The Requires

 

The Development Requires

07/01 2016

1.0.1

1.0.1.0

  Sources   Download

MIT

The Requires

 

The Development Requires

05/01 2016

1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

05/01 2016

0.4.0

0.4.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

04/01 2016

0.3.0

0.3.0.0

  Sources   Download

The Requires

 

25/03 2015

0.2.1

0.2.1.0

  Sources   Download

The Requires

 

25/03 2015

0.2.0

0.2.0.0

  Sources   Download

The Requires

 

24/03 2015

0.1.0

0.1.0.0

  Sources   Download

The Requires