Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Mvc / ResponseSender / AbstractResponseSender.php
blob013e921c3614f8ecbc2a8920cb2ea545af63d783
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Mvc\ResponseSender;
12 use Zend\Http\Header\MultipleHeaderInterface;
14 abstract class AbstractResponseSender implements ResponseSenderInterface
16 /**
17 * Send HTTP headers
19 * @param SendResponseEvent $event
20 * @return PhpEnvironmentResponseSender
22 public function sendHeaders(SendResponseEvent $event)
24 if (headers_sent() || $event->headersSent()) {
25 return $this;
28 $response = $event->getResponse();
30 foreach ($response->getHeaders() as $header) {
31 if ($header instanceof MultipleHeaderInterface) {
32 header($header->toString(), false);
33 continue;
35 header($header->toString());
38 $status = $response->renderStatusLine();
39 header($status);
41 $event->setHeadersSent();
42 return $this;