Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Zend Modulemanager Laravel Package

zendframework/zend-modulemanager

Zend Framework’s ModuleManager helps organize and load application modules with dependency resolution, configuration merging, and event-driven initialization. It supports module discovery, autoloading, and predictable bootstrapping for modular ZF apps.

View on GitHub
Deep Wiki
Context7

Getting Started

This package is part of the legacy Zend Framework ecosystem and is archived—use only if maintaining older ZF2 or early Laminas projects. For day-to-day use, you’ll interact with it in config/modules.config.php and module directories (e.g., config/, Module.php). Start by inspecting config/application.config.php (ZF2) or config/modules.config.php (Laminas) to see enabled modules. The core concept is that each module registers configuration, services, and event listeners via its Module.php class—implement methods like getConfig(), getAutoloaderConfig(), and onBootstrap(MvcEvent $e).

Implementation Patterns

  • Modular Configuration: Split config into module-specific config/module.config.php, merged via getConfig() in Module.php. Merge order: application config → module configs (alphabetical by module name unless overridden).
  • Service Registration: Use getServiceConfig() in Module.php to define factories, invokables, and deinters. Prefer factories for type-hinted dependencies.
  • Event-Driven Bootstrap: Leverage onBootstrap() to attach global listeners (e.g., for authentication, translation setup) or module-specific MVC events (e.g., MvcEvent::EVENT_ROUTE).
  • CLI Integration: Use ModuleManager in CLI tools via ApplicationInterface—common in ZF2-era admin panels or console modules.
  • Dependency Injection: Modules often depend on others via ModuleManager::loadModules() hooks—check \ModuleManager::getLocator()->get('ModuleManager') in older code.

Gotchas and Tips

  • Archived & Legacy: Avoid for new projects. Migrate to Laminas laminas-modulemanager only if upgrading ZF2 to Laminas MVC—but modern apps should use Laminas laminas-servicemanager + PSR-11 directly.
  • Autoloading Quirks: getAutoloaderConfig() often uses Zend\Loader\ClassMapAutoloader or spl_autoload_register callbacks. Confirm autoloading paths in composer.json’s autoload section too—this package does not replace Composer autoloading.
  • Configuration Overwrites: Late-loaded modules can unintentionally override earlier configs (e.g., view_manager settings). Use config_glob_paths or config_cache_enabled to debug merged config issues.
  • Service Listener Conflicts: EventManager events in onBootstrap() can cause duplicate handlers if multiple modules attach to MvcEvent::EVENT_DISPATCH. Always use unique identifiers or check for existing listeners.
  • Deprecated Aliases: ServiceManager aliases like Zend\Db\Adapter\AdapterInterface require manual mapping in getServiceConfig()—modern apps should use laminas-db’s PSR-11 support.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4