Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Matthew Weier O'Phinney:
Using Composer to Autoload ZF Modules
Aug 18, 2016 @ 14:50:11

Matthew Weier O'Phinney has a new post to his site showing you how to can use Composer to autoload Zend Framework modules right along with the rest of the ZF components.

One aspect of Zend Framework 3, we paid particular focus on was leveraging the Composer ecosystem. We now provide a number of Composer plugins for handling things such as initial project installation, registering installed modules with the application, and more. It's the "more" I particularly want to talk about.

With ZF2, we were able to realize the ability to install third-party modules into existing applications, enabling a module ecosystem. [...] For the v3 release, we wanted to solve this if we could. We were able to do so via a Composer plugin, zend-component-installer.

This allows ZF module authors to add details into the "extra" section of their Composer configuration, making it so the plugin understands how to load the module automatically. They've also created a package to help do the same for Apigility applications and lets you remove any calls to "getAutoloaderConfig" in your modules.

tagged: zendframework autoload composer zf3 apigility configuration extra package

Link: https://mwop.net/blog/2016-08-17-zf-composer-autoloading.html


Trending Topics: