Advertisement
Guest User

module.php

a guest
Dec 22nd, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.66 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Zend Framework (http://framework.zend.com/)
  4.  *
  5.  * @link      http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
  6.  * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
  7.  * @license   http://framework.zend.com/license/new-bsd New BSD License
  8.  */
  9.  
  10. namespace Application;
  11.  
  12. use Zend\Mvc\ModuleRouteListener;
  13. use Zend\Mvc\MvcEvent;
  14.  
  15. use Doctrine\ORM\Tools\Setup;
  16. use Doctrine\ORM\EntityManager;
  17. use Doctrine\ORM\Configuration;
  18. use Doctrine\Common\Cache\ArrayCache as Cache;
  19. use Doctrine\Common\Annotations\AnnotationRegistry;
  20. use Doctrine\Common\ClassLoader;
  21.  
  22. class Module
  23. {
  24.     const DOCTRINE_BASE_PATH = '/../../vendor/doctrine/orm/lib/Doctrine';
  25.  
  26.     public function onBootstrap(MvcEvent $e)
  27.     {
  28.         $eventManager        = $e->getApplication()->getEventManager();
  29.         $moduleRouteListener = new ModuleRouteListener();
  30.         $moduleRouteListener->attach($eventManager);
  31.     }
  32.  
  33.     public function getConfig()
  34.     {
  35.         return include __DIR__ . '/config/module.config.php';
  36.     }
  37.  
  38.     public function getAutoloaderConfig()
  39.     {
  40.         return array(
  41.             'Zend\Loader\StandardAutoloader' => array(
  42.                 'namespaces' => array(
  43.                     __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
  44.                     'Doctrine\Common' => realpath(__DIR__ . self::DOCTRINE_BASE_PATH . '/Common'),
  45.                     'Doctrine\DBAL' => realpath(__DIR__ . self::DOCTRINE_BASE_PATH . '/DBAL'),
  46.                     'Doctrine\ORM' => realpath(__DIR__ . self::DOCTRINE_BASE_PATH . '/ORM')
  47.                 ),
  48.             ),
  49.         );
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement