'modules' => array(
'Application',
),
- 'module_manager_options' => array(
- 'enable_config_cache' => false,
+ 'module_listener_options' => array(
+ 'config_cache_enabled' => false,
'cache_dir' => realpath(__DIR__ . '/../data/cache'),
- 'enable_dependency_check' => false,
- 'enable_auto_installation' => false,
- 'manifest_dir' => realpath(__DIR__ . '/../data'),
),
);
-Subproject commit 009f6ea929602017a1cccf2c6e8a257f0b3d69c1
+Subproject commit dd8426fc451be263b747b151810780a5f1f21c60
use Zend\Module\Manager,
Zend\EventManager\StaticEventManager,
- Zend\Loader\AutoloaderFactory;
+ Zend\Module\Consumer\AutoloaderProvider;
-class Module
+class Module implements AutoloaderProvider
{
protected $view;
protected $viewListener;
public function init(Manager $moduleManager)
{
- $this->initAutoloader();
$events = StaticEventManager::getInstance();
$events->attach('bootstrap', 'bootstrap', array($this, 'initializeView'), 100);
}
- protected function initAutoloader()
+ public function getAutoloaderConfig()
{
- AutoloaderFactory::factory(array(
+ return array(
'Zend\Loader\ClassMapAutoloader' => array(
__DIR__ . '/autoload_classmap.php',
),
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
),
- ));
+ );
}
public function getConfig($env = null)
{
$app = $e->getParam('application');
$locator = $app->getLocator();
- $config = $e->getParam('modules')->getMergedConfig();
+ $config = $e->getParam('config');
$view = $this->getView($app);
$viewListener = $this->getViewListener($view, $config);
$app->events()->attachAggregate($viewListener);
require_once 'Zend/Loader/AutoloaderFactory.php';
Zend\Loader\AutoloaderFactory::factory(array('Zend\Loader\StandardAutoloader' => array()));
-$appConfig = new Zend\Config\Config(include __DIR__ . '/../configs/application.config.php');
+$appConfig = include __DIR__ . '/../configs/application.config.php';
$moduleLoader = new Zend\Loader\ModuleAutoloader($appConfig['module_paths']);
$moduleLoader->register();
-$moduleManager = new Zend\Module\Manager(
- $appConfig['modules'],
- new Zend\Module\ManagerOptions($appConfig['module_manager_options'])
-);
+$moduleManager = new Zend\Module\Manager($appConfig['modules']);
+$listenerOptions = new Zend\Module\Listener\ListenerOptions($appConfig['module_listener_options']);
+$moduleManager->setDefaultListenerOptions($listenerOptions);
+$moduleManager->loadModules();
// Create application, bootstrap, and run
-$bootstrap = new Zend\Mvc\Bootstrap($moduleManager);
+$bootstrap = new Zend\Mvc\Bootstrap($moduleManager->getMergedConfig());
$application = new Zend\Mvc\Application;
$bootstrap->bootstrap($application);
$application->run()->send();