Phalcon\Debug return 200 OK

Why status of response with

$debug = new \Phalcon\Debug();
$debug->listen(true, true);

always has 200 OK? How I can send 500? If I want set development mode for app and send ajax request I have html body from debug tool and status 200(



11.1k

This code with $debug->debugVar sending 500 but I think it's sucks

switch (ENVIRONMENT)
{
    case 'local':
    case 'development':
        $debug = new \Phalcon\Debug();
        $debug->listen(true, true);
        $debug->debugVar([
            "response" => http_response_code(500)
        ]);
        error_reporting(E_ALL);
        ini_set('display_errors', 1);
    break;

    case 'testing':
    case 'production':
        ini_set('display_errors', 0);
        error_reporting(E_ALL & ~E_NOTICE);
    break;

    default:
        exit('The application environment is not set correctly.');
}


3.9k

...and prevents dumping errors into log files.

My topic: https://forum.phalconphp.com/discussion/17749/phalcondebug-how-to-changeexpand-behaviour

I recommend other tool like whoops. Is anyone here who is responsible for communication forum <-> Phalcon team or we have to do it ourselves? I don't know how to contribute bugs or opinions.



11.1k
edited Feb '18

...and prevents dumping errors into log files.

Wow, it's very big trouble I think.

@phalcon Phalcon please answer