1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-05 04:37:38 +02:00

PHP Versions less than 5.3.6 throws undefined constant DEBUG_BACKTRAC… (#986)

* PHP Versions less than 5.3.6 throws undefined constant DEBUG_BACKTRACE_IGNORE_ARGS 

Notice: Use of undefined constant DEBUG_BACKTRACE_IGNORE_ARGS - assumed 'DEBUG_BACKTRACE_IGNORE_ARGS' in /vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php on line 58

* Define DEBUG_BACKTRACE_IGNORE_ARGS if not defined.

* Solution using PHP_VERSION_ID and not defining...

...DEBUG_BACKTRACE_IGNORE_ARGS
This commit is contained in:
Brant Messenger
2017-06-18 18:16:17 -05:00
committed by Jordi Boggiano
parent 120499283b
commit 1b769912d1

View File

@@ -55,7 +55,12 @@ class IntrospectionProcessor
return $record;
}
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
/*
* http://php.net/manual/en/function.debug-backtrace.php
* As of 5.3.6, DEBUG_BACKTRACE_IGNORE_ARGS option was added.
* Any version less than 5.3.6 must use the DEBUG_BACKTRACE_IGNORE_ARGS constant value '2'.
*/
$trace = debug_backtrace((PHP_VERSION_ID < 50306) ? 2 : DEBUG_BACKTRACE_IGNORE_ARGS);
// skip first since it's always the current method
array_shift($trace);