src/sb/Controller/HTTP.php
public function sendError($error_num, $err_str = '')
    {

        if (empty($err_str)) {
            switch ($error_num) {
                case 400:
                    $err_str = 'Bad Request';
                    break;

                case 401:
                    $err_str = 'Unauthorized';
                    break;

                case 403:
                    $err_str = 'Forbidden';
                    break;

                case 404:
                    $err_str = 'Not Found';
                    break;

                case 405:
                    $err_str = 'Method Not Allowed';
                    break;

                case 410:
                    $err_str = 'Gone';
                    break;

                case 415:
                    $err_str = 'Unsupported Media Type';
                    break;

                case 500:
                    $err_str = 'Internal Server Error';
                    break;

                case 501:
                    $err_str = 'Not Implemented';
                    break;
            }
        }
        $this->sendHeader("HTTP/1.0 $error_num $err_str");
    }
public function sendError($error_num, $err_str = '')
    {

        if (empty($err_str)) {
            switch ($error_num) {
                case 400:
                    $err_str = 'Bad Request';
                    break;

                case 401:
                    $err_str = 'Unauthorized';
                    break;

                case 403:
                    $err_str = 'Forbidden';
                    break;

                case 404:
                    $err_str = 'Not Found';
                    break;

                case 405:
                    $err_str = 'Method Not Allowed';
                    break;

                case 410:
                    $err_str = 'Gone';
                    break;

                case 415:
                    $err_str = 'Unsupported Media Type';
                    break;

                case 500:
                    $err_str = 'Internal Server Error';
                    break;

                case 501:
                    $err_str = 'Not Implemented';
                    break;
            }
        }
        $this->sendHeader("HTTP/1.0 $error_num $err_str");
    }
public function sendError ( $ error_num , $ err_str = '' ) { if ( empty ( $ err_str ) ) { switch ( $ error_num ) { case 400 : $ err_str = 'Bad Request' ; break ; case 401 : $ err_str = 'Unauthorized' ; break ; case 403 : $ err_str = 'Forbidden' ; break ; case 404 : $ err_str = 'Not Found' ; break ; case 405 : $ err_str = 'Method Not Allowed' ; break ; case 410 : $ err_str = 'Gone' ; break ; case 415 : $ err_str = 'Unsupported Media Type' ; break ; case 500 : $ err_str = 'Internal Server Error' ; break ; case 501 : $ err_str = 'Not Implemented' ; break ; } } $ this -> sendHeader ( "HTTP/1.0 $error_num $err_str" ) ; }
Send an http error header
@param integer $error_num The number of the error as found http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
@param string $err_str The error string to send, defaults sent for
400, 401, 403, 404, 405, 410, 415, 500, 501 unless specified
Send an http error header