本文整理汇总了PHP中Symfony\Component\HttpKernel\Client::doRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::doRequest方法的具体用法?PHP Client::doRequest怎么用?PHP Client::doRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\HttpKernel\Client
的用法示例。
在下文中一共展示了Client::doRequest方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doRequest
protected function doRequest($request)
{
if ($this->credentials !== null) {
$request->attributes->set('indieauth.client.token', $this->credentials);
}
return parent::doRequest($request);
}
示例2: doRequest
/**
* Makes a request.
*
* @param Request $request A Request instance
*
* @return Response A Response instance
*/
protected function doRequest($request)
{
// avoid shutting down the Kernel if no request has been performed yet
// WebTestCase::createClient() boots the Kernel but do not handle a request
if ($this->hasPerformedRequest) {
$this->kernel->shutdown();
} else {
$this->hasPerformedRequest = true;
}
return parent::doRequest($request);
}
示例3: doRequest
/**
* @param \Symfony\Component\HttpFoundation\Request $request
*/
protected function doRequest($request)
{
if ($this->rebootable) {
if ($this->hasPerformedRequest) {
$this->rebootKernel();
} else {
$this->hasPerformedRequest = true;
}
}
return parent::doRequest($request);
}
示例4: doRequest
protected function doRequest($request)
{
$services = [];
if (self::$hasPerformedRequest) {
$services = $this->persistServices();
$this->kernel = clone $this->kernel;
} else {
self::$hasPerformedRequest = true;
}
$this->kernel->boot();
$container = $this->kernel->getContainer();
if ($this->kernel->getContainer()->has('profiler')) {
$container->get('profiler')->enable();
}
$this->injectPersistedServices($services);
return parent::doRequest($request);
}
示例5: doRequest
/**
* {@inheritdoc}
*
* @param Request $request A Request instance
*
* @return Response A Response instance
*/
protected function doRequest($request)
{
// avoid shutting down the Kernel if no request has been performed yet
// WebTestCase::createClient() boots the Kernel but do not handle a request
if ($this->hasPerformedRequest) {
$this->kernel->shutdown();
} else {
$this->hasPerformedRequest = true;
}
if ($this->profiler) {
$this->profiler = false;
$this->kernel->boot();
$this->kernel->getContainer()->get('profiler')->enable();
}
return parent::doRequest($request);
}