App.php
protected static function _setDebug( )
		{
			$debug =  Module::merge( ptc_path( 'root' ) . '/app/config/debug.php' ); 
			if ( file_exists( ptc_path( 'root' ) . '/app/config/debug_ajax.php' ) )
			{
				if ( !empty( $_SERVER[ 'HTTP_X_REQUESTED_WITH' ] ) && 
					( 'xmlhttprequest' === strtolower( $_SERVER[ 'HTTP_X_REQUESTED_WITH' ] ) || 
								'ajax' === strtolower( $_SERVER[ 'HTTP_X_REQUESTED_WITH' ]) ) ) 
				{
					$debug_ajax =  require_once( ptc_path( 'root' ) . '/app/config/debug_ajax.php' ); 
					$debug = array_merge( $debug , $debug_ajax );
				}
			}
			static::option( 'debug' , $debug );
			require_once( ptc_path( 'root' ) . '/vendor/phptoolcase/phptoolcase/PtcDebug.php' );
			if ( !is_null( ptc_array_get( static::$_config , 'debug.replace_error_handler' , null ) ) )
			{
				$die_on_error = ( ptc_array_get( static::$_config , 'debug.die_on_error' ) ) ? true : false;
				Debug::setErrorHandler( $die_on_error );
				ptc_array_set( static::$_config , 'debug.replace_error_handler' , false , true );
			}
			if ( ptc_array_get( static::$_config , 'debug.start' ) )
			{ 
				$exclude = ptc_array_get( static::$_config , 'debug.exclude_categories' );
				if ( is_string( $exclude ) && array_key_exists( $exclude , static::$_debugLevels ) )
				{
					ptc_array_set( static::$_config , 'debug.exclude_categories' , 
										static::$_debugLevels[ $exclude ], true );
				}
				if ( isset( $_GET[ 'debug_level' ] ) )
				{
					ptc_array_set( static::$_config , 'debug.exclude_categories' , 
									static::$_debugLevels[ $_GET[ 'debug_level' ] ] , true );
				}
				Debug::load( static::$_config[ 'debug' ] ); 
			}
		}
protected static function _setDebug( )
		{
			$debug =  Module::merge( ptc_path( 'root' ) . '/app/config/debug.php' ); 
			if ( file_exists( ptc_path( 'root' ) . '/app/config/debug_ajax.php' ) )
			{
				if ( !empty( $_SERVER[ 'HTTP_X_REQUESTED_WITH' ] ) && 
					( 'xmlhttprequest' === strtolower( $_SERVER[ 'HTTP_X_REQUESTED_WITH' ] ) || 
								'ajax' === strtolower( $_SERVER[ 'HTTP_X_REQUESTED_WITH' ]) ) ) 
				{
					$debug_ajax =  require_once( ptc_path( 'root' ) . '/app/config/debug_ajax.php' ); 
					$debug = array_merge( $debug , $debug_ajax );
				}
			}
			static::option( 'debug' , $debug );
			require_once( ptc_path( 'root' ) . '/vendor/phptoolcase/phptoolcase/PtcDebug.php' );
			if ( !is_null( ptc_array_get( static::$_config , 'debug.replace_error_handler' , null ) ) )
			{
				$die_on_error = ( ptc_array_get( static::$_config , 'debug.die_on_error' ) ) ? true : false;
				Debug::setErrorHandler( $die_on_error );
				ptc_array_set( static::$_config , 'debug.replace_error_handler' , false , true );
			}
			if ( ptc_array_get( static::$_config , 'debug.start' ) )
			{ 
				$exclude = ptc_array_get( static::$_config , 'debug.exclude_categories' );
				if ( is_string( $exclude ) && array_key_exists( $exclude , static::$_debugLevels ) )
				{
					ptc_array_set( static::$_config , 'debug.exclude_categories' , 
										static::$_debugLevels[ $exclude ], true );
				}
				if ( isset( $_GET[ 'debug_level' ] ) )
				{
					ptc_array_set( static::$_config , 'debug.exclude_categories' , 
									static::$_debugLevels[ $_GET[ 'debug_level' ] ] , true );
				}
				Debug::load( static::$_config[ 'debug' ] ); 
			}
		}
protected static function _setDebug ( ) { $ debug = Module :: merge ( ptc_path ( 'root' ) . '/app/config/debug.php' ) ; if ( file_exists ( ptc_path ( 'root' ) . '/app/config/debug_ajax.php' ) ) { if ( ! empty ( $ _SERVER [ 'HTTP_X_REQUESTED_WITH' ] ) && ( 'xmlhttprequest' === strtolower ( $ _SERVER [ 'HTTP_X_REQUESTED_WITH' ] ) || 'ajax' === strtolower ( $ _SERVER [ 'HTTP_X_REQUESTED_WITH' ] ) ) ) { $ debug_ajax = require_once ( ptc_path ( 'root' ) . '/app/config/debug_ajax.php' ) ; $ debug = array_merge ( $ debug , $ debug_ajax ) ; } } static :: option ( 'debug' , $ debug ) ; require_once ( ptc_path ( 'root' ) . '/vendor/phptoolcase/phptoolcase/PtcDebug.php' ) ; if ( ! is_null ( ptc_array_get ( static :: $ _config , 'debug.replace_error_handler' , null ) ) ) { $ die_on_error = ( ptc_array_get ( static :: $ _config , 'debug.die_on_error' ) ) ? true : false ; Debug :: setErrorHandler ( $ die_on_error ) ; ptc_array_set ( static :: $ _config , 'debug.replace_error_handler' , false , true ) ; } if ( ptc_array_get ( static :: $ _config , 'debug.start' ) ) { $ exclude = ptc_array_get ( static :: $ _config , 'debug.exclude_categories' ) ; if ( is_string ( $ exclude ) && array_key_exists ( $ exclude , static :: $ _debugLevels ) ) { ptc_array_set ( static :: $ _config , 'debug.exclude_categories' , static :: $ _debugLevels [ $ exclude ] , true ) ; } if ( isset ( $ _GET [ 'debug_level' ] ) ) { ptc_array_set ( static :: $ _config , 'debug.exclude_categories' , static :: $ _debugLevels [ $ _GET [ 'debug_level' ] ] , true ) ; } Debug :: load ( static :: $ _config [ 'debug' ] ) ; } }
Set debug at runtime
Set debug at runtime