Sends no cache headers to ensure that a response wont get cached on its way to the client.

@author Benjamin Carl <opensource@clickalicious.de>
@return bool TRUE if header could be send, otherwise FALSE
@access public
@static
504055
public static function sendNoCacheHeaders()
    {
        if (false === headers_sent()) {
            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-store, no-cache, must-revalidate');
            header('Cache-Control: post-check=0, pre-check=0', false);
            header('Pragma: no-cache');

            return true;
        }

        return false;
    }
842428
public function send()
    {
        try {
            if (!$this->preSend()) {
                return false;
            }
            return $this->postSend();
        } catch (phpmailerException $exc) {
            $this->mailHeader = '';
            $this->setError($exc->getMessage());
            if ($this->exceptions) {
                throw $exc;
            }
            return false;
        }
    }
314632
public function sendHeaders()
    {
        foreach ($this->getHeaders() as $name => $values) {
            foreach ($values as $value) {
                header(sprintf('%s: %s', $name, $value), false);
            }
        }

        return $this;
    }
662002
protected function sendHeader()
	{
		$this->openHandle();

		$target= $this->path.($this->query? '?'.$this->query : '' ).($this->fragment? '#'.$this->fragment : '' );

		$this->writeLine("{$this->method} {$target} HTTP/{$this->version}");
		$this->writeLine("Host: {$this->host}");

		foreach( $this->headers as $key=>$value ){
			$this->writeLine("$key: $value");
		}
		$this->writeLine('');
	}
694490
public function send()
    {
        if (php_sapi_name() == 'cli') {
            return true;
        }

        // We add of the X-Powered-By header when disable_x_powered_by is true
        if (!$this->disable_x_powered_by) {
            $this->response->addHeader('X-Powered-By', 'Bow Framework');
        }

        $this->prefix = '';

        $method = $this->request->method();

        // We verify the existence of a special method DELETE, PUT
        if ($method == 'POST') {
            if ($this->special_method !== null) {
                $method = $this->special_method;
            }
        }

        // We verify the existence of the method of the request in
        // the routing collection
        if (!isset($this->routes[$method])) {
            // We verify and call function associate by 404 code
            $this->response->status(404);

            if (empty($this->error_code)) {
                $this->response->send(
                    sprintf('Cannot %s %s 404', $method, $this->request->path())
                );
            }

            return false;
        }

        $response = null;

        $error = true;

        foreach ($this->routes[$method] as $key => $route) {
            // The route must be an instance of Route
            if (!($route instanceof Route)) {
                continue;
            }

            // We launch the search of the method that arrived in the query
             // then start checking the url of the request
            if (!$route->match($this->request->path())) {
                continue;
            }

            $this->current['path'] = $route->getPath();

            // We call the action associate with the route
            $response = $route->call();
            $error = false;

            break;
        }

        // Error management
        if (!$error) {
            return $this->sendResponse($response);
        }

        // We apply the 404 error code
        $this->response->status(404);

        if (array_key_exists(404, $this->error_code)) {
            $response = Actionner::execute($this->error_code[404], []);

            return $this->sendResponse($response);
        }

        if (is_string($this->config['view.404'])) {
            $response = $this->response->render($this->config['view.404']);

            return $this->sendResponse($response);
        }

        throw new RouterException(
            sprintf('La route "%s" n\'existe pas', $this->request->path()),
            E_ERROR
        );
    }
1183215
public function sendHeaders()
    {
        // headers have already been sent by the developer
        if (headers_sent()) {
            return $this;
        }

        /* RFC2616 - 14.18 says all Responses need to have a Date */
        if (!$this->headers->has('Date')) {
            $this->setDate(\DateTime::createFromFormat('U', time()));
        }

        // headers
        foreach ($this->headers->allPreserveCaseWithoutCookies() as $name => $values) {
            foreach ($values as $value) {
                header($name.': '.$value, false, $this->statusCode);
            }
        }

        // status
        header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode);

        // cookies
        foreach ($this->headers->getCookies() as $cookie) {
            if ($cookie->isRaw()) {
                setrawcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly());
            } else {
                setcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly());
            }
        }

        return $this;
    }
972109
public function send()
	{
		$result = true;

		// process the cookies in this jar
		foreach ($this->jar as $cookie)
		{
			if ( ! $cookie->send())
			{
				$result = false;
			}
		}

		// and the cookies in this jar's children
		foreach ($this->children as $cookie)
		{
			if ( ! $cookie->send())
			{
				$result = false;
			}
		}

		return $result;
	}
413033
public function send()
    {
        if (!static::isSent()) {
            static::call('send', $this);
            foreach ($this->headers as $header => $value) {
                $this->setHttpHeader($header, $value);
            }
            http_response_code($this->status);
            echo $this->body;
            static::$sent = true;
            return true;
        }
        return false;
    }
1262042
public function sendHeaders()
    {
        deprecationWarning(
            'Will be removed in 4.0.0'
        );

        $file = $line = null;
        if (headers_sent($file, $line)) {
            Log::warning("Headers already sent in {$file}:{$line}");

            return;
        }

        $codeMessage = $this->_statusCodes[$this->_status];
        $this->_setCookies();
        $this->_sendHeader("{$this->_protocol} {$this->_status} {$codeMessage}");
        $this->_setContentType();

        foreach ($this->headers as $header => $values) {
            foreach ((array)$values as $value) {
                $this->_sendHeader($header, $value);
            }
        }
    }
833678
private function send_status_headers() {
	if ($this->redirect_location) {
		if ($this->http_status == self::STATUS_OK) {
			$this->set_http_status(self::STATUS_TEMPORARY_REDIRECT);
		}
		
		header('Location: '.$this->redirect_location, $replace=true, $this->http_status);
		return;
	}
	
	http_response_code($this->http_status);
}
808404
public function echoHeader() {
        if ($this->status != 200) {
            http_response_code($this->status);
        } else if (defined('CACHE_EXPIRE') && CACHE_EXPIRE) {
            Response::cache(CACHE_EXPIRE);
        }
        if (!empty ($this->headers) && is_array($this->headers)) {
            foreach ($this->headers as $name => $value) {
                @header("$name: $value", true);
            }
        }
    }
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;
    }
797852
protected function sendHeaders()
    {
        header(sprintf('%s %s', self::PROTOCOL_VERSION, ResponseCode::getMessageForCode($this->statusCode)));

        foreach ($this->headers as $name => $value) {
            header(sprintf("%s: %s", $name, $value));
        }
    }
559613
public function sendHeaders(): self
    {
        // headers have already been sent by the developer
        if (\headers_sent()) {
            return $this;
        }

        /* RFC2616 - 14.18 says all Responses need to have a Date */
        if (!$this->header->has('Date')) {
            $this->setDate(\DateTime::createFromFormat('U', (string) \time()));
        }

        // status
        \header('HTTP/' . $this->version . ' ' . $this->status . ' ' . $this->reason, true, $this->status);

        // headers
        $headers = $this->header->all();
        $this->cookie->inject($headers);

        foreach ($this->header->all() as $name => $values) {
            $first = true;
            foreach ($values as $value) {
                \header($name . ': ' . $value, $first, $this->status);
                $first = false;
            }
        }

        return $this;
    }
273477
public function sendHeaders()
	{
		if (!$this->checkHeadersSent())
		{
			foreach ($this->response->headers as $header)
			{
				if ('status' == strtolower($header['name']))
				{
					// 'status' headers indicate an HTTP status, and need to be handled slightly differently
					$this->header(ucfirst(strtolower($header['name'])) . ': ' . $header['value'], null, (int) $header['value']);
				}
				else
				{
					$this->header($header['name'] . ': ' . $header['value']);
				}
			}
		}

		return $this;
	}
779531
public function send()
    {
        if ($this->sent()) {
            throw new Exceptions\HeadersAlreadySentException(
                "Headers already sent"
            );
        }

        $this->sent = true;

        foreach ($this as $header) {
            $header->send();
        }

        return $this;
    }
1134743
public function sendHeaderResponse()
    {
        if ($this->response != false) {
            $this->response->sendHeaders();

            return $this->response->getWpStatusCodeHeader();
        }
    }