protected function doOutput(string $mime)
    {
        // Set HTTP response code
        http_response_code($this->response_code);

        // Set headers
        if (!headers_sent())
        {
            foreach ($this->headers as $name => $value)
                header($name . ': ' . $value);
        
            // Set cookies
            foreach ($this->cookies as $cookie)
            {
                setcookie(
                    $cookie->getName(),
                    $cookie->getValue(),
                    $cookie->getExpires(),
                    $cookie->getPath(),
                    $cookie->getDomain(),
                    $cookie->getSecure(),
                    $cookie->getHTTPOnly()
                );
            }
        }
        else
            self::$logger->critical('Headers were already sent when Responder wants to send them');

        // Perform output
        $this->result->getResponse()->output($mime);

        // We're done
        $desc = StatusCode::description($this->response_code);
        self::$logger->info("[{0} {1}] {2}", [$this->response_code, $desc, $this->request->url]);
    }
protected function doOutput(string $mime)
    {
        // Set HTTP response code
        http_response_code($this->response_code);

        // Set headers
        if (!headers_sent())
        {
            foreach ($this->headers as $name => $value)
                header($name . ': ' . $value);
        
            // Set cookies
            foreach ($this->cookies as $cookie)
            {
                setcookie(
                    $cookie->getName(),
                    $cookie->getValue(),
                    $cookie->getExpires(),
                    $cookie->getPath(),
                    $cookie->getDomain(),
                    $cookie->getSecure(),
                    $cookie->getHTTPOnly()
                );
            }
        }
        else
            self::$logger->critical('Headers were already sent when Responder wants to send them');

        // Perform output
        $this->result->getResponse()->output($mime);

        // We're done
        $desc = StatusCode::description($this->response_code);
        self::$logger->info("[{0} {1}] {2}", [$this->response_code, $desc, $this->request->url]);
    }
protected function doOutput ( string $ mime ) { // Set HTTP response code http_response_code ( $ this -> response_code ) ; // Set headers if ( ! headers_sent ( ) ) { foreach ( $ this -> headers as $ name => $ value ) header ( $ name . ': ' . $ value ) ; // Set cookies foreach ( $ this -> cookies as $ cookie ) { setcookie ( $ cookie -> getName ( ) , $ cookie -> getValue ( ) , $ cookie -> getExpires ( ) , $ cookie -> getPath ( ) , $ cookie -> getDomain ( ) , $ cookie -> getSecure ( ) , $ cookie -> getHTTPOnly ( ) ) ; } } else self :: $ logger -> critical ( 'Headers were already sent when Responder wants to send them' ) ; // Perform output $ this -> result -> getResponse ( ) -> output ( $ mime ) ; // We're done $ desc = StatusCode :: description ( $ this -> response_code ) ; self :: $ logger -> info ( "[{0} {1}] {2}" , [ $ this -> response_code , $ desc , $ this -> request -> url ] ) ; }
This method sends data to the client after all preparational work has
been done.

@param string $mime The mime-type of the response that has been selected
This method sends data to the client after all preparational work has been done .