Send HTTP Headers
@param boolean $clean
@return void
498668
public static function send($clean = TRUE){

        if( !headers_sent() ){

            foreach( self::$headers as $header ){

                if( is_array($header) ){
                    call_user_func_array('header', $header);
                }else{
                    header($header);
                }

            }

            if( $clean ){
                self::$headers = array();
            }

        }

        self::$sent = TRUE;
    }
898376
public function pushLogToSession(bool $clean): void
    {
        //====================================================================//
        // Decide if Current Logged User Needs to Be Notified or Not
        if (!$this->isAllowedNotify()) {
            return;
        }
        //====================================================================//
        // Catch Splash Errors
        if (!empty(Splash::log()->err)) {
            foreach (Splash::log()->err as $message) {
                $this->session->getFlashBag()->add('error', $message);
            }
        }
        //====================================================================//
        // Catch Splash Warnings
        if (!empty(Splash::log()->war)) {
            foreach (Splash::log()->war as $message) {
                $this->session->getFlashBag()->add('warning', $message);
            }
        }
        //====================================================================//
        // Catch Splash Messages
        if (!empty(Splash::log()->msg)) {
            foreach (Splash::log()->msg as $message) {
                $this->session->getFlashBag()->add('success', $message);
            }
        }
        //====================================================================//
        // Clear Splash Log
        if ($clean) {
            Splash::log()->cleanLog();
        }
    }
314632
public function sendHeaders()
    {
        foreach ($this->getHeaders() as $name => $values) {
            foreach ($values as $value) {
                header(sprintf('%s: %s', $name, $value), false);
            }
        }

        return $this;
    }
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());
            }
        }
    }
401218
public function send()
    {
        foreach ($this->headers as $key => $value) {
            header("$key: " . implode(',', $value));
        }

        if($this->hasHeader('Content-Type') === false) {
            header(vsprintf(
                'Content-Type: %s',
                $this->hasHeader('Content-Type') ? $this->getHeader('Content-Type') : [$this->contentType]
            ));
        }

        http_response_code($this->getStatusCode());

        if ($this->stream !== null) {
            if ($this->compression) {
                ob_start('ob_gzhandler');
            }
            echo (string)$this->getBody();
        }

        ob_end_flush();
    }
1124802
public function send($flush = false)
	{
		if (!$this->getContent() && $this->original && $this->headers->get('Content-Type'))
		{
			$this->setContent($this->original);
		}

		return parent::send($flush);
	}
1057351
public function setHeader($key, $value, $replace = true, $http_response_code = null)
    {
        $this->swooleResponse->header($key. $value);
    }
937063
protected function sendHeader(string $header, string $content): void
    {
        if (!headers_sent() && self::$sendHeaders) {
            header(sprintf('%s: %s', $header, $content));
        }
    }
1330499
function setHeaders($headers) {
      if (is_array($headers)) {
        reset($headers);
        while (list($name, $value) = each($headers)) {
          $this->requestHeaders[$name] = $value;
        }
      }
    }
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;
	}
1222951
public function send(string $protocol)
    {
        header("$protocol {$this->statusCode} {$this->statusText}");
        foreach ($this->headers->getStringifiedArray() as $header) {
            header($header);
        }

        echo $this->body;
    }
13085
public function sendAllHeaders()
    {
        if ($this->status_header !== null) {
            header($this->status_header);
        }

        foreach ($this->headers as $name => $value) {
            header($name . ': ' . $value);
        }
    }
1137756
protected function send_header() {
        global $CFG;

        if (defined('BEHAT_SITE_RUNNING')) {
            // For text based formats - we cannot test the output with behat if we force a file download.
            return;
        }
        if (is_https()) { // HTTPS sites - watch out for IE! KB812935 and KB316431.
            header('Cache-Control: max-age=10');
            header('Pragma: ');
        } else { //normal http - prevent caching at all cost
            header('Cache-Control: private, must-revalidate, pre-check=0, post-check=0, max-age=0');
            header('Pragma: no-cache');
        }
        header('Expires: '. gmdate('D, d M Y H:i:s', 0) .' GMT');
        header("Content-Type: $this->mimetype\n");
        header("Content-Disposition: attachment; filename=\"$this->filename\"");
    }
1266000
public function sendResult($result)
    {
        if (@ob_get_length()) {
            @ob_end_clean();
        }
        if (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'application/json') !== false) {
            header('Content-Type: application/json; charset=' . APP_CHARSET, true);
        } else {
            header('Content-Type: text/plain; charset=' . APP_CHARSET, true);
        }
        echo json_encode($result);
        die();
    }
76482
private function sendHeaders()
    {
        foreach ($this->body->getHeaders() as $key => $value) {
            $key = join('-', array_map('ucfirst', explode('-', $key)));
            header(sprintf('%s: %s', $key, $value));
        }
    }
1352496
public function setHeaders($headers)
    {
        foreach ($headers as $header => $value) {
            $this->setHeader($header, $value);
        }
    }
128697
public function send($flush = false)
	{
		if ($this->compress)
		{
			$this->setContent($this->squeeze($this->getContent()));
		}

		$this->sendHeaders();
		$this->sendContent();

		if ($flush)
		{
			if (function_exists('fastcgi_finish_request'))
			{
				fastcgi_finish_request();
			}
			elseif ('cli' !== PHP_SAPI)
			{
				static::closeOutputBuffers(0, true);
				flush();
			}
		}

		return $this;
	}