Debug

Configuration & usage

Phalcon\Debug provides visual aids as well as additional information for developers to easily locate errors produced in an application.

NOTE Please make sure that this component is not used in production environments, as it can reveal information about your server to attackers

Configurations

Debug Settings

# set true to enable app debug
APP_DEBUG=true

# Set true to enable phalcon debug
DEBUG_ENABLE=true

# Phalcon Debug Settings
DEBUG_EXCEPTION=true
DEBUG_LOW_SEVERITY=false
DEBUG_SHOW_FILES=true
DEBUG_SHOW_BACKTRACE=true
DEBUG_SHOW_FRAGMENT=true
DEBUG_URI=

Enabling Application Debug

# Enable Application debug
APP_DEBUG=true

Disabling Debug

# Disabling App & Phalcon Debug
DEBUG_ENABLE=false
APP_DEBUG=false

Usage

// if the class is aware of injections
$debug = $this->debug;

// if the container is present
$debug = $this->di->get('debug');

// to access the shared db service
$debug = Di::getDefault()->get('debug');

Sources

Last updated