Skip to content

Instantly share code, notes, and snippets.

@dantleech
Created October 11, 2013 09:55
Show Gist options
  • Select an option

  • Save dantleech/6932332 to your computer and use it in GitHub Desktop.

Select an option

Save dantleech/6932332 to your computer and use it in GitHub Desktop.
protected function getDoctrine_Dbal_DefaultConnectionService()
{
$a = new \Doctrine\DBAL\Logging\LoggerChain();
$a->addLogger(new \Symfony\Bridge\Doctrine\Logger\DbalLogger($this->get('monolog.logger.doctrine'), $this->get('debug.stopwatch')));
$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);
return $this->services['doctrine.dbal.default_connection'] = $this->get('doctrine.dbal.connection_factory')->createConnection(array('dbname' => 'yprox', 'user' => 'root', 'password' => NULL, 'path' => '/home/daniel/www/yProximite/yProx/apps/admin/cache/test/test.db', 'driver' => 'pdo_sqlite', 'host' => 'localhost', 'port' => NULL, 'driverOptions' => array()), $b, $d, array());
$d->addEventSubscriber($this->get('yprox.doctrine.site_cache_listener'));
$d->addEventSubscriber($c);
$d->addEventSubscriber($this->get('stof_doctrine_extensions.listener.loggable'));
$d->addEventSubscriber(new \FOS\UserBundle\Entity\UserListener($this));
$d->addEventSubscriber($this->get('yprox.doctrine.lock_listener'));
$d->addEventSubscriber($this->get('ylly.inherit_data.subscriber'));
$d->addEventSubscriber($this->get('ylly_theme.doctrine.create_version_subscriber'));
$d->addEventSubscriber($this->get('yprox.doctrine.subscriber'));
$d->addEventSubscriber($this->get('yprox.site.router.doctrine_subscriber'));
$d->addEventSubscriber($this->get('stof_doctrine_extensions.listener.translatable'));
$d->addEventListener(array(0 => 'loadClassMetadata'), $this->get('yprox.doctrine.extend_discriminator'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment