本文整理汇总了PHP中Symfony\Component\HttpKernel\HttpKernelInterface::boot方法的典型用法代码示例。如果您正苦于以下问题:PHP HttpKernelInterface::boot方法的具体用法?PHP HttpKernelInterface::boot怎么用?PHP HttpKernelInterface::boot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\HttpKernel\HttpKernelInterface
的用法示例。
在下文中一共展示了HttpKernelInterface::boot方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createClient
/**
* Creates a Client.
*
* @param array $options An array of options to pass to the createKernel class
* @param array $server An array of server parameters
* @param array $cookies An array of Symfony\Component\BrowserKit\Cookie
*
* @return Client A Client instance
*/
public function createClient(array $options = array(), array $server = array(), array $cookies = array())
{
if (null !== $this->kernel && $this->kernelReset) {
$this->kernel->shutdown();
$this->kernel->boot();
}
if (null === $this->kernel) {
$this->kernel = $this->createKernel($options);
$this->kernel->boot();
}
$client = $this->kernel->getContainer()->get('test.client');
$client->setServerParameters($server);
foreach ($cookies as $cookie) {
$client->getCookieJar()->set($cookie);
}
return $client;
}
示例2: doRun
/**
* {@inheritdoc}
*/
public function doRun(InputInterface $input, OutputInterface $output)
{
$this->kernel->boot();
$this->kernel->flush();
return parent::doRun($input, $output);
}
示例3: __construct
public function __construct(HttpKernelInterface $kernel, $cacheDir = null)
{
$kernel->boot();
parent::__construct($kernel, $cacheDir);
}