zendframework/zf2 — pull request #5651 by radnan (2013-12-30 04:18:47+00:00)
Title: Allow modules to load their own dependencies

Just testing the waters here.

Let's say our application has 3 modules A, B, and C. Module B depends on modules C, D, and E.

```
A
B -> C, D, E
C
```

But in our `application.config.php` we only specify A, B, and C.

```php
return array(
'modules' => array(
'A',
'B',
'C',
),
);
```

This little patch will allow B to load its dependencies D and E without having the user to specify it in their `application.config.php`.

```php
namespace B;

use Zend\ModuleManager\ModuleManager;

class Module
{
public function init(ModuleManager $modules)
{
$modules->loadModule('C');
$modules->loadModule('D');
$modules->loadModule('E');
}
}
```