24 lines
578 B
PHP
24 lines
578 B
PHP
<?php
|
|
// force-debug.php
|
|
// Optional debug bootstrap that can be toggled with FORCE_DEBUG_ERRORS=1.
|
|
|
|
$forceDebug = getenv('FORCE_DEBUG_ERRORS');
|
|
if ($forceDebug === false) {
|
|
return;
|
|
}
|
|
|
|
$normalized = strtolower(trim($forceDebug));
|
|
$enabled = in_array($normalized, ['1', 'true', 'yes', 'on'], true);
|
|
|
|
if (!$enabled) {
|
|
return;
|
|
}
|
|
|
|
error_reporting(E_ALL);
|
|
ini_set('display_errors', '1');
|
|
ini_set('display_startup_errors', '1');
|
|
ini_set('log_errors', '1');
|
|
ini_set('error_log', '/proc/self/fd/2');
|
|
|
|
error_log('[force-debug] Verbose error reporting enabled via FORCE_DEBUG_ERRORS');
|