Esempio n. 1
0
 public function onBootstrap(Event $e)
 {
     $application = $e->getApplication();
     $eventManager = $application->getEventManager();
     $eventManager->attach(MvcEvent::EVENT_DISPATCH, array($this, 'setApplicationSection'));
     $eventManager->attach(MvcEvent::EVENT_DISPATCH, array($this, 'setLayout'), 31);
     $eventManager->attach(MvcEvent::EVENT_DISPATCH_ERROR, array($this, 'setLayout'), 31);
     $app = $e->getParam('application');
     $sm = $app->getServiceManager();
     $evm = $sm->get('doctrine.eventmanager.orm_default');
     $config = $sm->get('Config');
     $tablePrefix = isset($config['doctrine']['connection']['orm_default']['params']['table_prefix']) ? $config['doctrine']['connection']['orm_default']['params']['table_prefix'] : FALSE;
     if ($tablePrefix) {
         $tablePrefix = new \Dxapp\Doctrine\Extension\TablePrefix($tablePrefix);
         $evm->addEventListener(\Doctrine\ORM\Events::loadClassMetadata, $tablePrefix);
     }
     $cache = $sm->get('doctrine.cache.memcache');
     $annotationReader = new \Doctrine\Common\Annotations\AnnotationReader();
     $cachedAnnotationReader = new \Doctrine\Common\Annotations\CachedReader($annotationReader, $cache);
     $em = $sm->get('doctrine.entitymanager.orm_default');
     \Doctrine\DBAL\Types\Type::overrideType('datetime', 'Dxapp\\Doctrine\\Types\\UTCDatetimeType');
     //		$em->getConnection()->getDatabasePlatform()->registerDoctrineTypeMapping('Datetime', 'datetime');
     $sluggableListener = new \Gedmo\Sluggable\SluggableListener();
     $sluggableListener->setAnnotationReader($cachedAnnotationReader);
     $evm->addEventSubscriber($sluggableListener);
     $treeListener = new \Gedmo\Tree\TreeListener();
     $treeListener->setAnnotationReader($cachedAnnotationReader);
     $evm->addEventSubscriber($treeListener);
     $timestampableListener = new \Gedmo\Timestampable\TimestampableListener();
     $timestampableListener->setAnnotationReader($cachedAnnotationReader);
     $evm->addEventSubscriber($timestampableListener);
     $translatableListener = new \Gedmo\Translatable\TranslatableListener();
     $translatableListener->setAnnotationReader($cachedAnnotationReader);
     $translatableListener->setTranslatableLocale('en');
     $translatableListener->setDefaultLocale('en');
     $evm->addEventSubscriber($translatableListener);
 }
Esempio n. 2
0
// sluggable
$sluggableListener = new Gedmo\Sluggable\SluggableListener();
// you should set the used annotation reader to listener, to avoid creating new one for mapping drivers
$sluggableListener->setAnnotationReader($cachedAnnotationReader);
$evm->addEventSubscriber($sluggableListener);
// tree
$treeListener = new Gedmo\Tree\TreeListener();
$treeListener->setAnnotationReader($cachedAnnotationReader);
$evm->addEventSubscriber($treeListener);
// loggable, not used in example
//$loggableListener = new Gedmo\Loggable\LoggableListener;
//$loggableListener->setAnnotationReader($cachedAnnotationReader);
//$loggableListener->setUsername('admin');
//$evm->addEventSubscriber($loggableListener);
// timestampable
$timestampableListener = new Gedmo\Timestampable\TimestampableListener();
$timestampableListener->setAnnotationReader($cachedAnnotationReader);
$evm->addEventSubscriber($timestampableListener);
// blameable
$blameableListener = new \Gedmo\Blameable\BlameableListener();
$blameableListener->setAnnotationReader($cachedAnnotationReader);
$blameableListener->setUserValue('MyUsername');
// determine from your environment
$evm->addEventSubscriber($blameableListener);
// translatable
$translatableListener = new Gedmo\Translatable\TranslatableListener();
// current translation locale should be set from session or hook later into the listener
// most important, before entity manager is flushed
$translatableListener->setTranslatableLocale('en');
$translatableListener->setDefaultLocale('en');
$translatableListener->setAnnotationReader($cachedAnnotationReader);
Esempio n. 3
0
 /**
  * Gets the 'doctrine.dbal.default_connection' service.
  *
  * This service is shared.
  * This method always returns the same instance of the service.
  *
  * @return \Doctrine\DBAL\Connection A Doctrine\DBAL\Connection instance
  */
 protected function getDoctrine_Dbal_DefaultConnectionService()
 {
     $a = $this->get('annotation_reader');
     $b = new \Doctrine\DBAL\Logging\LoggerChain();
     $b->addLogger(new \Symfony\Bridge\Doctrine\Logger\DbalLogger($this->get('monolog.logger.doctrine', ContainerInterface::NULL_ON_INVALID_REFERENCE), $this->get('debug.stopwatch', ContainerInterface::NULL_ON_INVALID_REFERENCE)));
     $b->addLogger($this->get('doctrine.dbal.logger.profiling.default'));
     $c = new \Doctrine\DBAL\Configuration();
     $c->setSQLLogger($b);
     $d = new \Gedmo\SoftDeleteable\SoftDeleteableListener();
     $d->setAnnotationReader($a);
     $e = new \Gedmo\Sortable\SortableListener();
     $e->setAnnotationReader($a);
     $f = new \Gedmo\Sluggable\SluggableListener();
     $f->setAnnotationReader($a);
     $g = new \Gedmo\Timestampable\TimestampableListener();
     $g->setAnnotationReader($a);
     $h = new \Symfony\Bridge\Doctrine\ContainerAwareEventManager($this);
     $h->addEventSubscriber($d);
     $h->addEventSubscriber($this->get('bigfoot_context.subscriber.doctrine'));
     $h->addEventSubscriber($e);
     $h->addEventSubscriber($f);
     $h->addEventSubscriber($this->get('stof_doctrine_extensions.listener.blameable'));
     $h->addEventSubscriber($g);
     $h->addEventSubscriber($this->get('stof_doctrine_extensions.listener.translatable'));
     $h->addEventListener(array(0 => 'onFlush', 1 => 'postPersist', 2 => 'postUpdate', 3 => 'postRemove'), $this->get('bigfoot_core.doctrine_listener'));
     $h->addEventListener(array(0 => 'loadClassMetadata'), $this->get('doctrine.orm.default_listeners.attach_entity_listeners'));
     return $this->services['doctrine.dbal.default_connection'] = $this->get('doctrine.dbal.connection_factory')->createConnection(array('driver' => 'pdo_sqlite', 'host' => NULL, 'port' => NULL, 'dbname' => NULL, 'user' => NULL, 'password' => NULL, 'charset' => 'UTF8', 'path' => $this->targetDirs[3] . '/app/database/sf3_database.sqlite', 'driverOptions' => array(), 'defaultTableOptions' => array()), $c, $h, array());
 }
 private static function configureListener($listener, Reader $reader)
 {
     switch ($listener) {
         case 'timestampable':
             $listener = new \Gedmo\Timestampable\TimestampableListener();
             $listener->setAnnotationReader($reader);
             return $listener;
         case 'soft-deleteable':
             $listener = new \Gedmo\SoftDeleteable\SoftDeleteableListener();
             $listener->setAnnotationReader($reader);
             return $listener;
     }
 }
 /**
  * Gets the 'doctrine.dbal.default_connection' service.
  *
  * This service is shared.
  * This method always returns the same instance of the service.
  *
  * @return \Doctrine\DBAL\Connection A Doctrine\DBAL\Connection instance
  */
 protected function getDoctrine_Dbal_DefaultConnectionService()
 {
     $a = new \Doctrine\DBAL\Logging\LoggerChain();
     $a->addLogger(new \Symfony\Bridge\Doctrine\Logger\DbalLogger($this->get('monolog.logger.doctrine', ContainerInterface::NULL_ON_INVALID_REFERENCE), $this->get('debug.stopwatch', ContainerInterface::NULL_ON_INVALID_REFERENCE)));
     $a->addLogger($this->get('doctrine.dbal.logger.profiling.default'));
     $b = new \Doctrine\DBAL\Configuration();
     $b->setSQLLogger($a);
     $c = new \Gedmo\Timestampable\TimestampableListener();
     $c->setAnnotationReader($this->get('annotation_reader'));
     $d = new \Symfony\Bridge\Doctrine\ContainerAwareEventManager($this);
     $d->addEventSubscriber($c);
     $d->addEventSubscriber(new \FOS\UserBundle\Doctrine\UserListener($this->get('fos_user.util.password_updater'), $this->get('fos_user.util.canonical_fields_updater')));
     $d->addEventListener(array(0 => 'loadClassMetadata'), $this->get('doctrine.orm.default_listeners.attach_entity_listeners'));
     return $this->services['doctrine.dbal.default_connection'] = $this->get('doctrine.dbal.connection_factory')->createConnection(array('driver' => 'pdo_mysql', 'host' => '127.0.0.1', 'port' => NULL, 'dbname' => 'rest', 'user' => 'rest', 'password' => 'Ium2F2CZHMdEj7OP8L5mcT1xfawNc2dt', 'charset' => 'UTF8', 'driverOptions' => array(), 'serverVersion' => 5.6, 'defaultTableOptions' => array()), $b, $d, array('enum' => 'string'));
 }
 /**
  * Gets the 'doctrine.dbal.switchfit_connection' service.
  *
  * This service is shared.
  * This method always returns the same instance of the service.
  *
  * @return \stdClass A stdClass instance.
  */
 protected function getDoctrine_Dbal_SwitchfitConnectionService()
 {
     $a = $this->get('annotation_reader');
     $b = new \Doctrine\DBAL\Logging\LoggerChain();
     $b->addLogger(new \Symfony\Bridge\Doctrine\Logger\DbalLogger($this->get('monolog.logger.doctrine', ContainerInterface::NULL_ON_INVALID_REFERENCE), $this->get('debug.stopwatch', ContainerInterface::NULL_ON_INVALID_REFERENCE)));
     $b->addLogger($this->get('doctrine.dbal.logger.profiling.switchfit'));
     $c = new \Doctrine\DBAL\Configuration();
     $c->setSQLLogger($b);
     $d = new \Gedmo\Timestampable\TimestampableListener();
     $d->setAnnotationReader($a);
     $e = new \Gedmo\Sluggable\SluggableListener();
     $e->setAnnotationReader($a);
     $f = new \Gedmo\Sortable\SortableListener();
     $f->setAnnotationReader($a);
     $g = new \Symfony\Bridge\Doctrine\ContainerAwareEventManager($this);
     $g->addEventSubscriber($d);
     $g->addEventSubscriber($this->get('nordcode_translation.listener.translatable'));
     $g->addEventSubscriber($e);
     $g->addEventSubscriber($f);
     $g->addEventSubscriber($this->get('stof_doctrine_extensions.listener.translatable'));
     return $this->services['doctrine.dbal.switchfit_connection'] = $this->get('doctrine.dbal.connection_factory')->createConnection(array('driver' => 'pdo_pgsql', 'dbname' => 'switchfit', 'user' => 'switchfit', 'host' => '127.0.0.1', 'port' => 5432, 'password' => 'switchfit', 'charset' => 'UTF', 'driverOptions' => array()), $c, $g, array());
 }
Esempio n. 7
0
 /** @override */
 public static function init($em, $reader)
 {
     static::$listener = $listener = new \Gedmo\Timestampable\TimestampableListener();
     $listener->setAnnotationReader($reader);
     $em->getEventManager()->addEventSubscriber($listener);
 }
Esempio n. 8
0
 private static function newConnect()
 {
     $dir = __DIR__ . '/../../libs/Doctrine/';
     $vendorPath = realpath($dir);
     $ExtensionPath = realpath($dir . '/DoctrineExtensions');
     require_once $vendorPath . '/Doctrine/Common/ClassLoader.php';
     // autoload all vendors
     $loader = new Doctrine\Common\ClassLoader('Doctrine\\Common', $vendorPath);
     $loader->register();
     $loader = new Doctrine\Common\ClassLoader('Doctrine\\DBAL', $vendorPath);
     $loader->register();
     $loader = new Doctrine\Common\ClassLoader('Doctrine\\ORM', $vendorPath);
     $loader->register();
     // gedmo extensions
     $loader = new Doctrine\Common\ClassLoader('Gedmo', $ExtensionPath);
     $loader->register();
     // Pagefanta
     $classLoader = new Doctrine\Common\ClassLoader("Pagerfanta", $ExtensionPath);
     $classLoader->register();
     //MYSQL Functions
     $classLoader = new \Doctrine\Common\ClassLoader('DoctrineExtensions', realpath($dir));
     $classLoader->register();
     // autoloader for Entity namespace
     $loader = new Doctrine\Common\ClassLoader('Entities', $dir);
     $loader->register();
     // ensure standard doctrine annotations are registered
     Doctrine\Common\Annotations\AnnotationRegistry::registerFile($vendorPath . '/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
     // Second configure ORM
     // globally used cache driver
     $cache = new Doctrine\Common\Cache\ArrayCache();
     $reader = new \Doctrine\Common\Annotations\AnnotationReader();
     Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace('Gedmo\\Mapping\\Annotation', $ExtensionPath);
     $driverChain = new \Doctrine\ORM\Mapping\Driver\DriverChain();
     $annotationDriver = new Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader, array($dir . 'Entities', $ExtensionPath . '/Gedmo/Tree/Entity'));
     // drivers
     $driverChain->addDriver($annotationDriver, 'Gedmo\\Tree\\Entity');
     $driverChain->addDriver($annotationDriver, 'Entities');
     // general ORM configuration
     $config = new Doctrine\ORM\Configuration();
     //$config->setProxyDir(sys_get_temp_dir());
     $config->setProxyDir($dir . '/Proxies');
     $config->setProxyNamespace('Proxy');
     $config->setAutoGenerateProxyClasses(true);
     // this can be based on production config. FALSE
     // register metadata driver
     $config->setMetadataDriverImpl($driverChain);
     // use our allready initialized cache driver
     $config->setMetadataCacheImpl($cache);
     $config->setQueryCacheImpl($cache);
     // Third, create event manager and hook prefered extension listeners
     $evm = new Doctrine\Common\EventManager();
     // gedmo extension listeners
     // tree
     $treeListener = new Gedmo\Tree\TreeListener();
     $treeListener->setAnnotationReader($reader);
     $evm->addEventSubscriber($treeListener);
     // timestampable
     $timestampableListener = new Gedmo\Timestampable\TimestampableListener();
     $timestampableListener->setAnnotationReader($reader);
     $evm->addEventSubscriber($timestampableListener);
     // mysql set names UTF-8 if required
     $evm->addEventSubscriber(new Doctrine\DBAL\Event\Listeners\MysqlSessionInit());
     // Finally, create entity manager
     $connection = array('dbname' => DB_DATABASE, 'user' => DB_USER, 'password' => DB_PASSWORD, 'host' => DB_HOST, 'driver' => 'pdo_mysql');
     $config->addCustomDatetimeFunction('YEAR', 'DoctrineExtensions\\Query\\Mysql\\Year');
     $config->addCustomDatetimeFunction('MONTH', 'DoctrineExtensions\\Query\\Mysql\\Month');
     $config->addCustomDatetimeFunction('DAY', 'DoctrineExtensions\\Query\\Mysql\\Day');
     $config->addCustomDatetimeFunction('HOUR', 'DoctrineExtensions\\Query\\Mysql\\Hour');
     $config->addCustomDatetimeFunction('DATE', 'DoctrineExtensions\\Query\\Mysql\\Date');
     $config->addCustomDatetimeFunction('DATEDIFF', 'DoctrineExtensions\\Query\\MySql\\DateDiff');
     try {
         $em = Doctrine\ORM\EntityManager::create($connection, $config, $evm);
     } catch (Exception $e) {
     }
     self::$EntityManager = $em;
 }
 protected function getDoctrine_Dbal_DefaultConnectionService()
 {
     $a = $this->get('annotation_reader');
     $b = new \Gedmo\Timestampable\TimestampableListener();
     $b->setAnnotationReader($a);
     $c = new \Gedmo\Sluggable\SluggableListener();
     $c->setAnnotationReader($a);
     $d = new \Symfony\Bridge\Doctrine\ContainerAwareEventManager($this);
     $d->addEventSubscriber($b);
     $d->addEventSubscriber($c);
     $d->addEventSubscriber($this->get('stof_doctrine_extensions.listener.translatable'));
     $d->addEventListener(array(0 => 'loadClassMetadata'), $this->get('doctrine.orm.default_listeners.attach_entity_listeners'));
     return $this->services['doctrine.dbal.default_connection'] = $this->get('doctrine.dbal.connection_factory')->createConnection(array('driver' => 'pdo_mysql', 'host' => '127.0.0.1', 'port' => NULL, 'dbname' => 'tutoecom', 'user' => 'root', 'password' => NULL, 'charset' => 'UTF8', 'driverOptions' => array(), 'defaultTableOptions' => array()), new \Doctrine\DBAL\Configuration(), $d, array());
 }
Esempio n. 10
0
 /**
  * Bootstrap the app
  * @return void 
  */
 public static function bootstrap()
 {
     if (!class_exists("Doctrine\\Common\\Version", false)) {
         self::registerNamespaces();
     }
     $isDevMode = true;
     $entityPath = ROOT_PATH . '/entities';
     $proxyPath = ROOT_PATH . '/proxies';
     $reader = new \Doctrine\Common\Annotations\AnnotationReader();
     $annotationDriver = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader);
     \Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace('Gedmo\\Mapping\\Annotation', ROOT_PATH . '/vendor/doctrine-extension/lib');
     $driverChain = new \Doctrine\ORM\Mapping\Driver\DriverChain();
     $annotationDriver = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader, array(ROOT_PATH . '/entities/Entity', ROOT_PATH . '/vendor/doctrine-extension/lib/Gedmo/Translatable/Entity', ROOT_PATH . '/vendor/doctrine-extension/lib/Gedmo/Tree/Entity'));
     //Drivers
     $driverChain->addDriver($annotationDriver, 'Gedmo\\Translatable\\Entity');
     $driverChain->addDriver($annotationDriver, 'Gedmo\\Tree\\Entity');
     $driverChain->addDriver($annotationDriver, 'Entity');
     //Tell doctrine that we use annotations for entities
     $config = \Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration(array($entityPath), $isDevMode, $proxyPath);
     $config->setMetadataDriverImpl($driverChain);
     //Attach listener to the event system event manager
     $eventManager = new \Doctrine\Common\EventManager();
     $treeListener = new \Gedmo\Tree\TreeListener();
     $treeListener->setAnnotationReader($reader);
     $eventManager->addEventSubscriber($treeListener);
     $sluggableListener = new \Gedmo\Sluggable\SluggableListener();
     $sluggableListener->setAnnotationReader($reader);
     $eventManager->addEventSubscriber($sluggableListener);
     $translationListener = new \Gedmo\Translatable\TranslationListener();
     $translationListener->setAnnotationReader($reader);
     $translationListener->setTranslatableLocale('en_us');
     $eventManager->addEventSubscriber($translationListener);
     $timestampListener = new \Gedmo\Timestampable\TimestampableListener();
     $timestampListener->setAnnotationReader($reader);
     $eventManager->addEventSubscriber($timestampListener);
     $sortableListener = new \Gedmo\Sortable\SortableListener();
     $sortableListener->setAnnotationReader($reader);
     $eventManager->addEventSubscriber($sortableListener);
     //Obtaining the entity manager
     $entityManager = \Doctrine\ORM\EntityManager::create(self::getConnectionOptions(), $config, $eventManager);
     //Register app type
     \Doctrine\DBAL\Types\Type::addType('point', 'Statme\\ORM\\PointType');
     \Doctrine\DBAL\Types\Type::addType('enumgender', 'Statme\\ORM\\Enum\\GenderType');
     \Doctrine\DBAL\Types\Type::addType('enumthreadstatus', 'Statme\\ORM\\Enum\\ThreadStatusType');
     \Doctrine\DBAL\Types\Type::addType('enumunittype', 'Statme\\ORM\\Enum\\UnitType');
     \Doctrine\DBAL\Types\Type::addType('enumprivacy', 'Statme\\ORM\\Enum\\PrivacyType');
     \Doctrine\DBAL\Types\Type::addType('enumsubscriptionstatus', 'Statme\\ORM\\Enum\\SubscriptionStatusType');
     //Register point type for schema tool
     $platform = $entityManager->getConnection()->getDatabasePlatform();
     $platform->registerDoctrineTypeMapping('point', 'point');
     $platform->registerDoctrineTypeMapping('enum', 'string');
     $platform->registerDoctrineTypeMapping('enumgender', 'enumgender');
     $platform->registerDoctrineTypeMapping('enumthreadstatus', 'enumthreadstatus');
     $platform->registerDoctrineTypeMapping('enumunittype', 'enumunittype');
     $platform->registerDoctrineTypeMapping('enumprivacy', 'enumprivacy');
     $platform->registerDoctrineTypeMapping('enumsubscriptionstatus', 'enumsubscriptionstatus');
     self::$entityManager = $entityManager;
     return;
 }
 /**
  * Gets the 'doctrine.dbal.default_connection' service.
  *
  * This service is shared.
  * This method always returns the same instance of the service.
  *
  * @return \Doctrine\DBAL\Connection A Doctrine\DBAL\Connection instance.
  */
 protected function getDoctrine_Dbal_DefaultConnectionService()
 {
     $a = $this->get('annotation_reader');
     $b = new \Doctrine\DBAL\Logging\LoggerChain();
     $b->addLogger(new \Symfony\Bridge\Doctrine\Logger\DbalLogger($this->get('monolog.logger.doctrine', ContainerInterface::NULL_ON_INVALID_REFERENCE), $this->get('debug.stopwatch', ContainerInterface::NULL_ON_INVALID_REFERENCE)));
     $b->addLogger($this->get('doctrine.dbal.logger.profiling.default'));
     $c = new \Doctrine\DBAL\Configuration();
     $c->setSQLLogger($b);
     $d = new \Gedmo\Timestampable\TimestampableListener();
     $d->setAnnotationReader($a);
     $e = new \Gedmo\Sluggable\SluggableListener();
     $e->setAnnotationReader($a);
     $f = new \Symfony\Bridge\Doctrine\ContainerAwareEventManager($this);
     $f->addEventSubscriber($d);
     $f->addEventSubscriber($e);
     $f->addEventSubscriber($this->get('stof_doctrine_extensions.listener.translatable'));
     $f->addEventListener(array(0 => 'loadClassMetadata'), $this->get('doctrine.orm.default_listeners.attach_entity_listeners'));
     return $this->services['doctrine.dbal.default_connection'] = $this->get('doctrine.dbal.connection_factory')->createConnection(array('driver' => 'pdo_mysql', 'host' => '127.0.0.1', 'port' => NULL, 'dbname' => 'tutoecom', 'user' => 'root', 'password' => NULL, 'charset' => 'UTF8', 'driverOptions' => array(), 'defaultTableOptions' => array()), $c, $f, array());
 }
 protected function getDoctrine_Dbal_SwitchfitConnectionService()
 {
     $a = $this->get('annotation_reader');
     $b = new \Gedmo\Sortable\SortableListener();
     $b->setAnnotationReader($a);
     $c = new \Gedmo\Sluggable\SluggableListener();
     $c->setAnnotationReader($a);
     $d = new \Gedmo\Timestampable\TimestampableListener();
     $d->setAnnotationReader($a);
     $e = new \Symfony\Bridge\Doctrine\ContainerAwareEventManager($this);
     $e->addEventSubscriber($b);
     $e->addEventSubscriber($c);
     $e->addEventSubscriber(new \Vich\UploaderBundle\EventListener\DoctrineUploaderListener($this->get('vich_uploader.adapter'), $this->get('vich_uploader.metadata_reader'), $this->get('vich_uploader.upload_handler')));
     $e->addEventSubscriber($d);
     $e->addEventSubscriber($this->get('nordcode_translation.listener.translatable'));
     $e->addEventSubscriber($this->get('stof_doctrine_extensions.listener.translatable'));
     return $this->services['doctrine.dbal.switchfit_connection'] = $this->get('doctrine.dbal.connection_factory')->createConnection(array('driver' => 'pdo_pgsql', 'dbname' => 'switchfit', 'user' => 'switchfit', 'host' => '127.0.0.1', 'port' => 5432, 'password' => 'switchfit', 'charset' => 'UTF', 'driverOptions' => array()), new \Doctrine\DBAL\Configuration(), $e, array());
 }
 /**
  * Gets the 'doctrine.dbal.default_connection' service.
  *
  * This service is shared.
  * This method always returns the same instance of the service.
  *
  * @return \Doctrine\DBAL\Connection A Doctrine\DBAL\Connection instance.
  */
 protected function getDoctrine_Dbal_DefaultConnectionService()
 {
     $a = $this->get('vich_uploader.metadata_reader');
     $b = $this->get('vich_uploader.upload_handler');
     $c = $this->get('annotation_reader');
     $d = new \Doctrine\DBAL\Logging\LoggerChain();
     $d->addLogger(new \Symfony\Bridge\Doctrine\Logger\DbalLogger($this->get('monolog.logger.doctrine', ContainerInterface::NULL_ON_INVALID_REFERENCE), $this->get('debug.stopwatch', ContainerInterface::NULL_ON_INVALID_REFERENCE)));
     $d->addLogger($this->get('doctrine.dbal.logger.profiling.default'));
     $e = new \Doctrine\DBAL\Configuration();
     $e->setSQLLogger($d);
     $f = new \Vich\UploaderBundle\Adapter\ORM\DoctrineORMAdapter();
     $g = new \Gedmo\Timestampable\TimestampableListener();
     $g->setAnnotationReader($c);
     $h = new \Gedmo\Sluggable\SluggableListener();
     $h->setAnnotationReader($c);
     $i = new \Symfony\Bridge\Doctrine\ContainerAwareEventManager($this);
     $i->addEventSubscriber(new \Vich\UploaderBundle\EventListener\Doctrine\CleanListener('title_image', $f, $a, $b));
     $i->addEventSubscriber($g);
     $i->addEventSubscriber(new \Vich\UploaderBundle\EventListener\Doctrine\RemoveListener('title_image', $f, $a, $b));
     $i->addEventSubscriber(new \Vich\UploaderBundle\EventListener\Doctrine\UploadListener('title_image', $f, $a, $b));
     $i->addEventSubscriber($h);
     $i->addEventListener(array(0 => 'loadClassMetadata'), $this->get('doctrine.orm.default_listeners.attach_entity_listeners'));
     return $this->services['doctrine.dbal.default_connection'] = $this->get('doctrine.dbal.connection_factory')->createConnection(array('driver' => 'pdo_mysql', 'host' => '127.0.0.1', 'port' => NULL, 'dbname' => 'blog', 'user' => 'root', 'password' => 877890, 'charset' => 'UTF8', 'driverOptions' => array(), 'defaultTableOptions' => array()), $e, $i, array());
 }