mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-18 08:19:05 +01:00
LSlog :: get_debug_backtrace_context(): fix/improve method
This commit is contained in:
parent
c6526a4e9a
commit
69addc15ea
1 changed files with 6 additions and 4 deletions
|
@ -286,12 +286,14 @@ class LSlog {
|
||||||
**/
|
**/
|
||||||
public static function get_debug_backtrace_context() {
|
public static function get_debug_backtrace_context() {
|
||||||
$traces = debug_backtrace();
|
$traces = debug_backtrace();
|
||||||
if (!is_array($traces) || count($traces) <= 2)
|
if (!is_array($traces) || count($traces) < 2)
|
||||||
return "";
|
return "unknown context";
|
||||||
|
|
||||||
$msg = array();
|
$msg = array();
|
||||||
for ($i=2; $i < count($traces); $i++) {
|
$j=0;
|
||||||
$trace = array("#$i");
|
for ($i=count($traces)-1; $i >= 1; $i--) {
|
||||||
|
$j += 1;
|
||||||
|
$trace = array("#$j");
|
||||||
if (isset($traces[$i]['file']))
|
if (isset($traces[$i]['file']))
|
||||||
$trace[] = $traces[$i]['file'].(isset($traces[$i]['line'])?":".$traces[$i]['line']:"");
|
$trace[] = $traces[$i]['file'].(isset($traces[$i]['line'])?":".$traces[$i]['line']:"");
|
||||||
if (isset($traces[$i]['class']) && isset($traces[$i]['function']))
|
if (isset($traces[$i]['class']) && isset($traces[$i]['function']))
|
||||||
|
|
Loading…
Reference in a new issue