Various clean up
authorEvan Coury <me@evancoury.com>
Sat, 22 Oct 2011 02:05:06 +0000 (19:05 -0700)
committerEvan Coury <me@evancoury.com>
Sat, 22 Oct 2011 02:05:06 +0000 (19:05 -0700)
- config returns array which index.php converts to zend\config\config
- Application module initAutoloader improved
- Application classmap updated

configs/application.config.php
modules/Application/Module.php
modules/Application/autoload_classmap.php
public/index.php

index daf929f..873c275 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-return new Zend\Config\Config(array(
+return array(
     'module_paths' => array(
         realpath(__DIR__ . '/../modules'),
     ),
@@ -13,4 +13,4 @@ return new Zend\Config\Config(array(
         'enable_auto_installation' => false,
         'manifest_dir'             => realpath(__DIR__ . '/../data'),
     ),
-));
+);
index df4dc5f..9dee84c 100644 (file)
@@ -2,10 +2,10 @@
 
 namespace Application;
 
-use InvalidArgumentException,
-    Zend\Module\Manager,
+use Zend\Module\Manager,
     Zend\Config\Config,
-    Zend\EventManager\StaticEventManager;
+    Zend\EventManager\StaticEventManager,
+    Zend\Loader\AutoloaderFactory;
 
 class Module
 {
@@ -21,7 +21,16 @@ class Module
 
     protected function initAutoloader($env = null)
     {
-        require __DIR__ . '/autoload_register.php';
+        AutoloaderFactory::factory(array(
+            'Zend\Loader\ClassMapAutoloader' => array(
+                __DIR__ . '/autoload_classmap.php',
+            ),
+            'Zend\Loader\StandardAutoloader' => array(
+                'namespaces' => array(
+                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
+                ),
+            ),
+        ));
     }
 
     public function getConfig()
index 890cf29..d4c4306 100644 (file)
@@ -2,8 +2,7 @@
 return array (
   'Application\\View\\Listener' => __DIR__ . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Application' . DIRECTORY_SEPARATOR . 'View' . DIRECTORY_SEPARATOR . 'Listener.php',
   'Application\\View\\Helper\\Url' => __DIR__ . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Application' . DIRECTORY_SEPARATOR . 'View' . DIRECTORY_SEPARATOR . 'Helper' . DIRECTORY_SEPARATOR . 'Url.php',
-  'Application\\Bootstrap' => __DIR__ . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Application' . DIRECTORY_SEPARATOR . 'Bootstrap.php',
   'Application\\Controller\\IndexController' => __DIR__ . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Application' . DIRECTORY_SEPARATOR . 'Controller' . DIRECTORY_SEPARATOR . 'IndexController.php',
   'Application\\Controller\\ErrorController' => __DIR__ . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Application' . DIRECTORY_SEPARATOR . 'Controller' . DIRECTORY_SEPARATOR . 'ErrorController.php',
   'Application\\Module' => __DIR__ . DIRECTORY_SEPARATOR . 'Module.php',
-);
\ No newline at end of file
+);
index 5c4778d..84f5f90 100644 (file)
@@ -13,7 +13,7 @@ set_include_path(implode(PATH_SEPARATOR, array(
 require_once 'Zend/Loader/AutoloaderFactory.php';
 Zend\Loader\AutoloaderFactory::factory(array('Zend\Loader\StandardAutoloader' => array()));
 
-$appConfig = include __DIR__ . '/../configs/application.config.php';
+$appConfig = new Zend\Config\Config(include __DIR__ . '/../configs/application.config.php');
 
 $moduleLoader = new Zend\Loader\ModuleAutoloader($appConfig['module_paths']);
 $moduleLoader->register();