Created
February 15, 2012 08:17
-
-
Save marcw/1834387 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Symfony\Component\ClassLoader\DebugUniversalClassLoader; | |
use Symfony\Component\Config\Loader\LoaderInterface; | |
use Symfony\Component\HttpKernel\Debug\ErrorHandler; | |
use Symfony\Component\HttpKernel\Debug\ExceptionHandler; | |
use Symfony\Component\HttpKernel\Kernel; | |
class AppKernel extends Kernel | |
{ | |
static protected $databaseConnection; | |
static protected $rabbitmqConnection; | |
// bla bla register bundles | |
public function boot() | |
{ | |
parent::boot(); | |
if ('test' === $this->getEnvironment()) { | |
if (null === static::$databaseConnection) { | |
static::$databaseConnection = $this->getContainer()->get('doctrine.dbal.default_connection'); | |
} else { | |
$this->getContainer()->set('doctrine.dbal.default_connection', static::$databaseConnection); | |
} | |
if (null === static::$rabbitmqConnection) { | |
static::$rabbitmqConnection = $this->getContainer()->get('old_sound_rabbit_mq.connection.default'); | |
} else { | |
$this->getContainer()->set('old_sound_rabbit_mq.connection.default', static::$rabbitmqConnection); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment