Update for new module event stuff and update zf2 submodule
authorEvan Coury <me@evancoury.com>
Fri, 9 Dec 2011 20:16:43 +0000 (13:16 -0700)
committerEvan Coury <me@evancoury.com>
Fri, 9 Dec 2011 20:16:43 +0000 (13:16 -0700)
Also adds the proposed chdir() change per the Dec 7th meeting.

config/application.config.php
public/index.php
vendor/ZendFramework

index ece654c..9edb86d 100644 (file)
@@ -1,14 +1,14 @@
 <?php
 return array(
-    'module_paths' => array(
-        realpath(dirname(__DIR__) . '/module'),
-        realpath(dirname(__DIR__) . '/vendor'),
-    ),
     'modules' => array(
         'Application',
     ),
     'module_listener_options' => array( 
         'config_cache_enabled' => false,
-        'cache_dir'            => realpath(dirname(__DIR__) . '/data/cache'),
+        'cache_dir'            => 'data/cache',
+        'module_paths' => array(
+            './module',
+            './vendor',
+        ),
     ),
 );
index 767893c..b8dc353 100644 (file)
@@ -1,20 +1,20 @@
 <?php
-require_once dirname(__DIR__) . '/vendor/ZendFramework/library/Zend/Loader/AutoloaderFactory.php';
+chdir(dirname(__DIR__));
+require_once 'vendor/ZendFramework/library/Zend/Loader/AutoloaderFactory.php';
 Zend\Loader\AutoloaderFactory::factory(array('Zend\Loader\StandardAutoloader' => array()));
 
-$appConfig = include dirname(__DIR__) . '/config/application.config.php';
+$appConfig = include 'config/application.config.php';
 
-$moduleLoader = new Zend\Loader\ModuleAutoloader($appConfig['module_paths']);
-$moduleLoader->register();
+$moduleManager    = new Zend\Module\Manager($appConfig['modules']);
+$listenerOptions  = new Zend\Module\Listener\ListenerOptions($appConfig['module_listener_options']);
+$defaultListeners = new Zend\Module\Listener\DefaultListenerAggregate($listenerOptions);
 
-$moduleManager = new Zend\Module\Manager($appConfig['modules']);
-$listenerOptions = new Zend\Module\Listener\ListenerOptions($appConfig['module_listener_options']);
-$moduleManager->setDefaultListenerOptions($listenerOptions);
-$moduleManager->getConfigListener()->addConfigGlobPath(dirname(__DIR__) . '/config/autoload/*.config.php');
+$defaultListeners->getConfigListener()->addConfigGlobPath('config/autoload/*.config.php');
+$moduleManager->events()->attachAggregate($defaultListeners);
 $moduleManager->loadModules();
 
 // Create application, bootstrap, and run
-$bootstrap   = new Zend\Mvc\Bootstrap($moduleManager->getMergedConfig());
+$bootstrap   = new Zend\Mvc\Bootstrap($defaultListeners->getConfigListener()->getMergedConfig());
 $application = new Zend\Mvc\Application;
 $bootstrap->bootstrap($application);
 $application->run()->send();
index b3d72e2..c9bf154 160000 (submodule)
@@ -1 +1 @@
-Subproject commit b3d72e224b74563bc9c29c30cb7d42ffa34efad8
+Subproject commit c9bf15469b77f06c048fda5cd707d304bd34650d