zendframework / zend-modulemanager

ModuleManager component from Zend Framework
BSD 3-Clause "New" or "Revised" License
44 stars 27 forks source link

[3.x] Disable Zend\Loader by default and add option to enable it #17

Closed Xerkus closed 7 years ago

Xerkus commented 8 years ago

This is breaking change @weierophinney I need your input on this PR.

Disable dependency on zendframework/zend-loader by default and disable related features in favor of other means of autoloading. Eg Composer, which is now de-facto industry standard.

New use_zend_loader module manager option controls if Zend\Loader should be used. Both ModuleAutoloader and AutoloaderProvider features are affected.

Example of config/application.config.php using zendframework/zend-loader:

<?php

return [
    'modules' => [
        'Application',
    ],
    'module_listener_options' => [
        'use_zend_loader' => true,
        // note that module paths only make sense if zend-loader is used
        'module_paths' => [
            './module',
            './vendor',
        ],
        'config_glob_paths' => [
            'config/autoload/{{,*.}global,{,*.}local}.php',
        ],
    ],
];

This PR replaces #4 Waiting for docs for the component to be merged.

RalfEggert commented 8 years ago

I really like this important change.

Just a quick note: please don't forget to add some docs for this new flag and explain how to configure composer to do the auto loading of the modules.