Ensure that headers are sent
@return boolean Were already sent?
559478
public function ensureSentHeaders()
    {
        if ($this->headers_sent) {
            return true;
        }
        if (isset($this->headers['STATUS'])) {
            $h = (isset($this->attrs->noHttpVer) && ($this->attrs->noHttpVer) ? 'Status: ' : $this->attrs->server['SERVER_PROTOCOL']) . ' ' . $this->headers['STATUS'] . "\r\n";
        } else {
            $h = '';
        }
        $http11 = $this->attrs->server['SERVER_PROTOCOL'] === 'HTTP/1.1';
        if ($this->contentLength === null
            && $this->upstream->checkChunkedEncCap()
            && $http11
        ) {
            $this->attrs->chunked = true;
        }
        if ($this->attrs->chunked) {
            $this->header('Transfer-Encoding: chunked');
        }

        if ($http11) {
            $connection = isset($this->attrs->server['HTTP_CONNECTION']) ? strtolower($this->attrs->server['HTTP_CONNECTION']) : 'keep-alive';
            if ($connection === 'keep-alive' && $this->upstream->getKeepaliveTimeout() > 0) {
                $this->header('Connection: keep-alive');
                $this->keepalive = true;
            } else {
                $this->header('Connection: close');
            }
        } else {
            $this->header('Connection: close');
        }

        foreach ($this->headers as $k => $line) {
            if ($k !== 'STATUS') {
                $h .= $line . "\r\n";
            }
        }
        $h .= "\r\n";
        $this->headers_sent_file = __FILE__;
        $this->headers_sent_line = __LINE__;
        $this->headers_sent = true;
        $this->upstream->requestOut($this, $h);
        return false;
    }
1321174
public function sendHeaders()
    {
        if (!headers_sent()) {
            header(
                sprintf(
                    'HTTP/%s %s %s',
                    $this->getProtocolVersion(),
                    $this->getStatusCode(),
                    ($this->isOk() ? '' : $this->getReasonPhrase())
                ),
                true,
                $this->getStatusCode()
            );

            foreach ($this->header as $name => $value) {
                $name = str_replace(' ', '-', ucwords(str_replace('-', ' ', $name)));
                header(sprintf('%s: %s', $name, implode(',', $value)), false, $this->statusCode);
            }

            foreach ($this->cookie as $cookie) {
                header(sprintf('Set-Cookie: %s', $cookie->asString()), false, $this->getStatusCode());
            }
        }
    }
83092
public function send()
	{
		$result = true;

		if ($this->isNew)
		{
			// make this cookie as used
			$this->isNew = false;

			// set the cookie
			$result = $this->wrapper->setcookie($this->name, $this->value, $this->config['expiration'], $this->config['path'], $this->config['domain'], $this->config['secure'], $this->config['http_only']);

			// mark the cookie as sent
			if ($result)
			{
				$this->isSent = true;
			}
		}
		elseif ($this->isDeleted)
		{
			// delete the cookie by nullifying and expiring it
			$result = $this->wrapper->setcookie($this->name, null, -86400, $this->config['path'], $this->config['domain'], $this->config['secure'], $this->config['http_only']);

			// mark the cookie as sent
			if ($result)
			{
				$this->isSent = true;
			}
		}

		return $result;
	}
196481
public function sendHeaders()
    {
        if($this->getRequesthandler()->getRequestMethod() == Jaxon::METHOD_GET)
        {
            header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
            header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
            header("Cache-Control: no-cache, must-revalidate");
            header("Pragma: no-cache");
        }

        $sCharacterSet = '';
        $sCharacterEncoding = trim($this->getOption('core.encoding'));
        if(($sCharacterEncoding) && strlen($sCharacterEncoding) > 0)
        {
            $sCharacterSet = '; charset="' . trim($sCharacterEncoding) . '"';
        }

        header('content-type: ' . $this->sContentType . ' ' . $sCharacterSet);
    }
1267866
public function sendHeaders()
    {
        if (headers_sent() === true) {
            return;
        }
        foreach ($this->renderHeaders() as $header) {
            header($header, false);
        }
        foreach ($this->headers->getCookies() as $cookie) {
            header('Set-Cookie: ' . $cookie, false);
        }
    }
495424
public function sendHeaders(): void
    {
        foreach ((array) $this->headers as $name => $value) {
            $this->sendHeader($name, $value);
        }
    }
622822
public function sendHeaders()
    {
        foreach ($this->headers->all() as $header => $value) {
            header(sprintf('%s:%s', $header, $value));
        }
    }
435096
public function sendHeader()
    {
        $file = $line = null;
        if ($this->isHeaderSent($file, $line)) {
            if ($this->wei->has('logger')) {
                $this->logger->debug(sprintf('Header has been at %s:%s', $file, $line));
            }
            return false;
        }

        // Send status
        $this->sendRawHeader(sprintf('HTTP/%s %d %s', $this->version, $this->statusCode, $this->statusText));

        // Send headers
        foreach ($this->headers as $name => $values) {
            foreach ($values as $value) {
                $this->sendRawHeader($name . ': ' . $value);
            }
        }

        $this->sendCookie();

        return true;
    }
91022
public function sendHeaders()
	{
		// Early return if headers already have been send
		if (headers_sent()) {
			return $this;
		}

		foreach ($this->headers as $key => $value) {
			header(
				sprintf('%s: %s', $key, is_array($value) ? implode('; ', $value) : $value),
				true,
				$this->statusCode
			);
		}

		header(sprintf('%s %s %s',
			self::$protocolVersionMap[$this->protocolVersion],
			$this->statusCode,
			self::$statusCodeMap[$this->statusCode]
		));

		return $this;
	}
706338
protected function sendHeaders()
    {
        if (headers_sent()) return false;

        header(sprintf(
            'HTTP/%s %s %s',
            $this->getProtocolVersion(),
            $this->getStatusCode(),
            $this->getReasonPhrase()
        ));

        foreach ($this->getHeaderKeys() as $name)
        {
            header(sprintf('%s: %s', $name, $this->getHeaderLine($name)), true);
        }

        return true;
    }
1069315
public function send()
    {
        $this->addHeaders();

        $this->meta = call_user_func($this->map, $this->options);

        return $this;
    }
1226551
protected function sendHttpHeaders(iterable $headers):void
    {
        foreach ($headers as $header => $value) {
            header("$header: $value", false);
        }
    }
1250957
public function send()	{

		$this->buildHeaders();
		$this->buildMsg();

		if (!self::$debug) {
			return $this->sendMail();
		}

		$headers = [];
		foreach($this->headers as $k => $v) {
			$headers[] = "$k: $v";
		}
		echo '<div style="border: solid 2px #888; background:#efe; font-family: monospace; font-size: 1em; padding: 1em; margin: 1em;">';
		echo is_array($this->receiver) ? implode(', ', $this->receiver) : $this->receiver, '<hr>';
		echo implode('<br>', $headers), '<hr>', $this->subject, '<hr>', nl2br($this->msg);
		echo '</div>';

		return true;

	}
73462
protected function storeStructuredHeader(): bool
    {
        if (is_null($this->structuredHeaders)) {
            return false;
        }
        $headers = array("");

        foreach ($this->structuredHeaders as $h) {
            $headers[] = $h['key'] . ': ' . $h['value'] . "\n";
        }
        $this->entry[PoTokens::TRANSLATED] = $headers;
        return true;
    }
760192
function sendHeaders()
    {
        if ($this->isHeadersSent())
            throw new \Exception('Headers was sent.');

        
        \Poirot\Http\Response\httpResponseCode($this->getMessageObject()->getStatusCode());
        
        /** @var iHeader $header */
        foreach ($this->getMessageObject()->headers() as $header)
            header( $header->render() );

        $this->isHeadersSent = true;
        return $this;
    }
289801
function send()
    {
        if (!headers_sent()) {
            extract($this->toArray());
            setcookie($name, $value, $expires, $path, $domain, $secure, $httponly);
        }
    }
627306
protected static function allowHeaders()
    {
        if (self::$needHeaders !== null) {
            return self::$needHeaders;
        }

        return self::$needHeaders = Request::is('GET') || Request::is('HEAD');
    }