You are here

public function HttpResponse::canSendHeaders in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/zendframework/zend-feed/src/PubSubHubbub/HttpResponse.php \Zend\Feed\PubSubHubbub\HttpResponse::canSendHeaders()

Can we send headers?

Parameters

bool $throw Whether or not to throw an exception if headers have been sent; defaults to false:

Return value

HttpResponse

Throws

Exception\RuntimeException

1 call to HttpResponse::canSendHeaders()
HttpResponse::sendHeaders in vendor/zendframework/zend-feed/src/PubSubHubbub/HttpResponse.php
Send all headers

File

vendor/zendframework/zend-feed/src/PubSubHubbub/HttpResponse.php, line 139

Class

HttpResponse

Namespace

Zend\Feed\PubSubHubbub

Code

public function canSendHeaders($throw = false) {
  $ok = headers_sent($file, $line);
  if ($ok && $throw) {
    throw new Exception\RuntimeException('Cannot send headers; headers already sent in ' . $file . ', line ' . $line);
  }
  return !$ok;
}