Server : Apache System : Linux webd348.cluster026.gra.hosting.ovh.net 5.15.148-ovh-vps-grsec-zfs-classid #1 SMP Thu Feb 8 09:41:04 UTC 2024 x86_64 User : hednacluml ( 122243) PHP Version : 8.3.9 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl Directory : /home/hednacluml/write/ecrire/src/ |
<?php namespace Spip; /** * Gestion des erreurs PHP * @internal */ final class ErrorHandler { static bool $done = false; public static function setup(?int $error_level = null): void { if (!self::$done) { self::$done = true; error_reporting($error_level); set_error_handler(self::class . '::user_deprecated', E_USER_DEPRECATED); } } /** Loger les `trigger_deprecated()` */ public static function user_deprecated(int $errno, string $errstr, string $errfile, int $errline): bool { if (!(\E_USER_DEPRECATED & $errno)) { return false; } $backtrace = debug_backtrace(); array_shift($backtrace); do { $t = array_shift($backtrace); $fqdn = ($t['class'] ?? '') . ($t['type'] ?? '') . ($t['function'] ?? ''); } while (in_array($fqdn, ['trigger_error', 'trigger_deprecation'])); $errfile = $t['file']; $errline = $t['line']; spip_log(sprintf('%s in %s on line %s', $errstr, $errfile, $errline), 'deprecated.' . _LOG_INFO); return false; } }