1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139:
<?php
/**
* MvcCore
*
* This source file is subject to the BSD 3 License
* For the full copyright and license information, please view
* the LICENSE.md file that are distributed with this source code.
*
* @copyright Copyright (c) 2016 Tom FlĂdr (https://github.com/mvccore/mvccore)
* @license https://mvccore.github.io/docs/mvccore/5.0.0/LICENCE.md
*/
namespace MvcCore\Debug;
trait Props {
/**
* Email recipient to send information about exceptions or errors,
* `"admin@localhost"` by default. This property is not used in core debug
* class, you need to instal extension `mvccore/ext-debug-tracy`.
* @var string
*/
public static $EmailRecepient = 'admin@localhost';
/**
* Relative path from app root to store any log information,
* `"~/Var/Logs"` by default.
* @var string
*/
public static $LogDirectory = '~/Var/Logs';
/**
* Initialize global development shorthands.
* @var callable
*/
public static $InitGlobalShortHands = [];
/**
* Semaphore to execute `\MvcCore\Debug::Init();` method only once.
* `TRUE` on `dev` environment, `FALSE` if any other environment detected.
* @var bool
*/
protected static $debugging = NULL;
/**
* All PHP and user notices, warnings and errors are automatically turned
* and thrown as `\ErrorException`, initialized into `TRUE` in `Init()`
* function by default.
* @var bool|NULL
*/
protected static $strictExceptionsMode = NULL;
/**
* Error levels to turn into exceptions by default.
* @var \int[]
*/
protected static $strictExceptionsModeDefaultLevels = [
E_ERROR, E_RECOVERABLE_ERROR,
E_CORE_ERROR, E_USER_ERROR,
E_WARNING, E_CORE_WARNING, E_USER_WARNING
];
/**
* Previous error handler before strict exceptions mode is defined.
* @var callable|NULL
*/
protected static $prevErrorHandler = NULL;
/**
* System config debug configuration root node name (`debug` by default)
* and all it's properties names.
* @var string
*/
protected static $systemConfigDebugProps = [
'sectionName' => 'debug', // debug section root node
'emailRecepient' => 'emailRecepient', // debug email, `admin@localhost` by default
'logDirectory' => 'logDirectory', // log directory, `/Var/Logs` by default
'strictExceptions' => 'strictExceptions', // strict exceptions mode, `TRUE` by default
];
/**
* Loaded system config debug section values.
* @var array|NULL
*/
protected static $systemConfigDebugValues = NULL;
/**
* Debugging and logging handlers, this should be customized in extended class.
* @var array
*/
protected static $handlers = [
'timer' => 'timerHandler',
'dump' => 'dumpHandler',
'barDump' => 'dumpHandler',
'log' => 'dumpHandler',
'exceptionHandler' => 'exceptionHandler',
'shutdownHandler' => 'ShutdownHandler',
];
/**
* Store for printed dumps by output buffering to send it at response end.
* @var array
*/
protected static $dumps = [];
/**
* Store timers start points.
* @var array
*/
protected static $timers = [];
/**
* `TRUE` for configured debug class as `\MvcCore\Debug`,
* `FALSE` for any other configured extension.
* @var bool
*/
protected static $originalDebugClass = TRUE;
/**
* `TRUE` if debug class is MvcCore original debug class and
* if logs directory has been already initialized.
* @var bool
*/
protected static $logDirectoryInitialized = FALSE;
/**
* Reference to singleton instance in `\MvcCore\Application::GetInstance();`.
* @var \MvcCore\Application
*/
protected static $app = NULL;
/**
* Reference to `\MvcCore\Application::GetInstance()->GetRequest()->GetStartTime();`.
* @var float
*/
protected static $requestBegin = 0.0;
}