public static function status($code = null, $trigger = true)
    {
        if (self::$httpCode === null) {
            self::$httpCode = \UtilsStatusCode();
        }

        if ($code === null || self::$httpCode === $code) {
            return self::$httpCode;
        } elseif (headers_sent() || $code < 100 || $code > 599) {
            return false;
        }

        header('X-PHP-Response-Code: ' . $code, true, $code);

        $lastCode = self::$httpCode;
        self::$httpCode = $code;

        if ($trigger) {
            App::trigger('changestatus', array($code, null));
        }

        return $lastCode;
    }
public static function status($code = null, $trigger = true)
    {
        if (self::$httpCode === null) {
            self::$httpCode = \UtilsStatusCode();
        }

        if ($code === null || self::$httpCode === $code) {
            return self::$httpCode;
        } elseif (headers_sent() || $code < 100 || $code > 599) {
            return false;
        }

        header('X-PHP-Response-Code: ' . $code, true, $code);

        $lastCode = self::$httpCode;
        self::$httpCode = $code;

        if ($trigger) {
            App::trigger('changestatus', array($code, null));
        }

        return $lastCode;
    }
public static function status ( $ code = null , $ trigger = true ) { if ( self :: $ httpCode === null ) { self :: $ httpCode = \ UtilsStatusCode ( ) ; } if ( $ code === null || self :: $ httpCode === $ code ) { return self :: $ httpCode ; } elseif ( headers_sent ( ) || $ code < 100 || $ code > 599 ) { return false ; } header ( 'X-PHP-Response-Code: ' . $ code , true , $ code ) ; $ lastCode = self :: $ httpCode ; self :: $ httpCode = $ code ; if ( $ trigger ) { App :: trigger ( 'changestatus' , array ( $ code , null ) ) ; } return $ lastCode ; }
Get or set status code and return last status code

@param int  $code
@param bool $trigger
@return int|bool
Get or set status code and return last status code