本文整理汇总了PHP中Magento\Framework\App\Response\Http::sendResponse方法的典型用法代码示例。如果您正苦于以下问题:PHP Http::sendResponse方法的具体用法?PHP Http::sendResponse怎么用?PHP Http::sendResponse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\App\Response\Http
的用法示例。
在下文中一共展示了Http::sendResponse方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendResponse
/**
* Send response
*
* @return void
*/
public function sendResponse()
{
if ($this->_filePath && $this->getHttpResponseCode() == 200) {
$this->_transferAdapter->send($this->_filePath);
} else {
parent::sendResponse();
}
}
示例2: sendResponse
/**
* {@inheritdoc}
*/
public function sendResponse()
{
$pluginInfo = $this->pluginList->getNext($this->subjectType, 'sendResponse');
if (!$pluginInfo) {
return parent::sendResponse();
} else {
return $this->___callPlugins('sendResponse', func_get_args(), $pluginInfo);
}
}
示例3: handleDeveloperMode
/**
* Error handler for developer mode
*
* @param Bootstrap $bootstrap
* @param \Exception $exception
* @return bool
*/
private function handleDeveloperMode(Bootstrap $bootstrap, \Exception $exception)
{
if ($bootstrap->isDeveloperMode()) {
$this->_response->setHttpResponseCode(500);
$this->_response->setHeader('Content-Type', 'text/plain');
$this->_response->setBody($exception->getMessage() . "\n" . $exception->getTraceAsString());
$this->_response->sendResponse();
return true;
}
return false;
}
示例4: handleDeveloperMode
/**
* Error handler for developer mode
*
* @param Bootstrap $bootstrap
* @param \Exception $exception
* @return bool
*/
private function handleDeveloperMode(Bootstrap $bootstrap, \Exception $exception)
{
if ($bootstrap->isDeveloperMode()) {
if (Bootstrap::ERR_IS_INSTALLED == $bootstrap->getErrorCode()) {
try {
$this->redirectToSetup($bootstrap, $exception);
return true;
} catch (\Exception $e) {
$exception = $e;
}
}
$this->_response->setHttpResponseCode(500);
$this->_response->setHeader('Content-Type', 'text/plain');
$this->_response->setBody($this->buildContentFromException($exception));
$this->_response->sendResponse();
return true;
}
return false;
}
示例5: assertHeaderNotPresent
protected function assertHeaderNotPresent($name)
{
$this->interceptedResponse->sendResponse();
$this->assertFalse($this->interceptedResponse->getHeader($name));
}