本文整理汇总了PHP中Symfony\Component\HttpKernel\Kernel::boot方法的典型用法代码示例。如果您正苦于以下问题:PHP Kernel::boot方法的具体用法?PHP Kernel::boot怎么用?PHP Kernel::boot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\HttpKernel\Kernel
的用法示例。
在下文中一共展示了Kernel::boot方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
/**
* @return null
*/
public function setUp()
{
$this->kernel = new \AppKernel('test', true);
$this->kernel->boot();
$this->container = $this->kernel->getContainer();
parent::setUp();
}
示例2: setUpSymfonyKernel
/**
* @before
*
*/
protected function setUpSymfonyKernel()
{
$this->kernel = $this->createKernel();
$this->kernel->boot();
$this->container = $this->kernel->getContainer();
$this->logger = $this->container->get('logger');
}
示例3: theFollowingAcmePhpConfiguration
/**
* @Given the following acme_php configuration:
*/
public function theFollowingAcmePhpConfiguration(PyStringNode $rawConfig)
{
$yaml = new Yaml();
$config = ['acme_php' => array_merge($this->getDefaultConfig(), $yaml->parse($rawConfig->getRaw()))];
$this->filesystem->dumpFile($this->acmeConfigPath, $yaml->dump($config, 4));
$this->kernel->shutdown();
$this->filesystem->remove($this->kernel->getCacheDir());
$this->kernel->boot();
}
示例4: _before
public function _before(\Codeception\TestCase $test) {
$this->kernel->boot();
$this->container = $this->kernel->getContainer();
if ($this->container->has('test.client')) { // it is Symfony2.2
$this->client = $this->container->get('test.client');
} else {
$this->client = new $this->clientClass($this->kernel);
}
$this->client->followRedirects(true);
}
示例5: setUpKernel
/**
* Sets up the kernel.
*
* @return void
*/
protected function setUpKernel()
{
if (null !== $this->kernel) {
$this->tearDownKernel();
}
$this->kernel = $this->createKernel(array('environment' => 'test', 'debug' => true));
$this->kernel->boot();
// Create Application
$this->application = new Application($this->kernel);
$this->application->setAutoExit(false);
// Reset database and load fixtures
$this->runConsole("doctrine:schema:drop", array("--force" => true));
$this->runConsole("doctrine:schema:create");
$this->runConsole("doctrine:fixtures:load", array("--no-interaction" => true));
}
示例6: _initialize
public function _initialize()
{
$cache = getcwd() . DIRECTORY_SEPARATOR . $this->config['app_path'] . DIRECTORY_SEPARATOR . 'bootstrap.php.cache';
if (!file_exists($cache)) {
throw new \RuntimeException('Symfony2 bootstrap file not found in ' . $cache);
}
require_once $cache;
$this->kernelClass = $this->getKernelClass();
$this->kernel = new $this->kernelClass('test', true);
$this->kernel->boot();
$dispatcher = $this->kernel->getContainer()->get('event_dispatcher');
$dispatcher->addListener('kernel.exception', function ($event) {
throw $event->getException();
});
}
示例7: _before
public function _before(\Codeception\TestCase $test)
{
$this->kernel->boot();
$this->container = $this->kernel->getContainer();
$this->client = new Symfony2Connector($this->kernel);
$this->client->followRedirects(true);
}
示例8: boot
public function boot()
{
$modules = array();
$this->loadModuleBundlesFromFilesystem();
$this->loadThemeBundlesFromFilesystem();
parent::boot();
}
示例9: boot
public function boot()
{
parent::boot();
if ($this->prepareDoctrineAfterBoot === true) {
$this->prepareDoctrine();
}
}
示例10: boot
public function boot()
{
parent::boot();
if (!$this->container->getParameter('bzion.miscellaneous.development')) {
if ($this->getEnvironment() != 'prod' || $this->isDebug()) {
throw new ForbiddenDeveloperAccessException('You are not allowed to access this page in a non-production ' . 'environment. Please change the "development" configuration ' . 'value and clear the cache before proceeding.');
}
}
if (in_array($this->getEnvironment(), array('profile', 'dev'), true)) {
Debug::enable();
}
Service::setGenerator($this->container->get('router')->getGenerator());
Service::setEnvironment($this->getEnvironment());
Service::setModelCache(new ModelCache());
Service::setContainer($this->container);
$this->setUpTwig();
// Ratchet doesn't support PHP's native session storage, so use our own
// if we need it
if (Service::getParameter('bzion.features.websocket.enabled') && $this->getEnvironment() !== 'test') {
$storage = new NativeSessionStorage(array(), new DatabaseSessionHandler());
$session = new Session($storage);
Service::getContainer()->set('session', $session);
}
Notification::initializeAdapters();
}
示例11: boot
public function boot()
{
if (!Doctrine\ODM\MongoDB\Types\Type::hasType('object')) {
Doctrine\ODM\MongoDB\Types\Type::addType('object', 'Payum\\Core\\Bridge\\Doctrine\\Types\\ObjectType');
}
parent::boot();
}
示例12: boot
/**
* dispatch an event when application is boot
*/
public function boot()
{
parent::boot();
if (self::isInstalled()) {
$this->getContainer()->get("event_dispatcher")->dispatch(TheliaEvents::BOOT);
}
}
示例13: boot
/**
* {@inheritdoc}
*/
public function boot()
{
if (true === $this->booted) {
return;
}
parent::boot();
$this->container->compile();
}
示例14: boot
/**
* {@inheritdoc}
*/
public function boot()
{
parent::boot();
if ($kernelModifier = $this->kernelModifier) {
$kernelModifier($this);
$this->kernelModifier = null;
}
}
示例15: boot
public function boot()
{
if (true === $this->booted) {
return;
}
++$this->containerNameCounter;
return parent::boot();
}