PHPackages                             saeven/zf2-dynamic-modules - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. saeven/zf2-dynamic-modules

ActiveLibrary[Framework](/categories/framework)

saeven/zf2-dynamic-modules
==========================

Dynamic module loader for ZF2

025PHP

Since Oct 16Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Saeven/zf2-dynamic-modules)[ Packagist](https://packagist.org/packages/saeven/zf2-dynamic-modules)[ RSS](/packages/saeven-zf2-dynamic-modules/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Dynamic Module Loader
=====================

[](#dynamic-module-loader)

I needed a means to dynamically wire modules into ZF2. This overrides the ModuleManager to create a system where closure conditions can be used to modify the application config's module array.

Configuration is very simple, and is done in your **application.config.php**, not in your module config!

Installation
------------

[](#installation)

```
composer require saeven/zf2-dynamic-modules

```

application.config.php
----------------------

[](#applicationconfigphp)

```
return [

    'service_manager' => [
        'factories' => [
            'ModuleManager' => 'CirclicalModuleLoader\Service\Factory\ModuleManagerFactory',
        ],
    ],

    'modules_conditional' => [
        'SomeModule' => function(){ return true; }
    ],

    'modules' => [

        // usual modules

    ],

    'module_listener_options' => [
        'config_glob_paths' => [
            'config/autoload/{,*.}{global,local}.php',
        ],
        'module_paths' => [
            './module',
            './vendor',
        ],
    ],
];

```

The magic happens in the closure that accompanies the modules\_conditional array. Your closure would return true or false based on environment conditions.

> Todo - this was done to conditionally load modules based on route, and perhaps, based on database data.

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/887224?v=4)[Alexandre Lemaire](/maintainers/Saeven)[@Saeven](https://github.com/Saeven)

---

Top Contributors

[![Saeven](https://avatars.githubusercontent.com/u/887224?v=4)](https://github.com/Saeven "Saeven (3 commits)")

### Embed Badge

![Health badge](/badges/saeven-zf2-dynamic-modules/health.svg)

```
[![Health](https://phpackages.com/badges/saeven-zf2-dynamic-modules/health.svg)](https://phpackages.com/packages/saeven-zf2-dynamic-modules)
```

###  Alternatives

[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k39.6M297](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
