Remove unused bootstrap_class config value from Application module
[zf2.biz/galerie.git] / modules / Application / Module.php
index 9dee84c..5bd9a70 100644 (file)
@@ -3,25 +3,23 @@
 namespace Application;
 
 use Zend\Module\Manager,
-    Zend\Config\Config,
     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($moduleManager->getOptions()->getApplicationEnv());
         $events = StaticEventManager::getInstance();
         $events->attach('bootstrap', 'bootstrap', array($this, 'initializeView'), 100);
     }
 
-    protected function initAutoloader($env = null)
+    public function getAutoloaderConfig()
     {
-        AutoloaderFactory::factory(array(
+        return array(
             'Zend\Loader\ClassMapAutoloader' => array(
                 __DIR__ . '/autoload_classmap.php',
             ),
@@ -30,19 +28,19 @@ class Module
                     __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
                 ),
             ),
-        ));
+        );
     }
 
-    public function getConfig()
+    public function getConfig($env = null)
     {
-        return new Config(include __DIR__ . '/configs/module.config.php');
+        return include __DIR__ . '/configs/module.config.php';
     }
     
     public function initializeView($e)
     {
         $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);