<?php
-return new Zend\Config\Config(array(
+return array(
'module_paths' => array(
realpath(__DIR__ . '/../modules'),
),
'enable_auto_installation' => false,
'manifest_dir' => realpath(__DIR__ . '/../data'),
),
-));
+);
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
{
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()
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
+);
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();