public function dumpStack(
        string $message = null,
        string $type = null,
        string $errfile = null,
        int $errline = null,
        $errcontext = null,
        array $stack = null
    ) {
        global $NABU_MESSAGE_TYPE_NAME;

        if (($errtype = nb_getArrayValueByKey($type, $NABU_MESSAGE_TYPE_NAME)) === null) {
            $this->nb_engine->errorLog("Unknow error type [$type]: $message in $errfile [line:$errline]");
        } else {
            $this->nb_engine->errorLog("$errtype: $message in $errfile [line:$errline]");
        }

        if ($stack === null) {
            $stack = debug_backtrace(true);
        }
        $count = -1;

        do {
            foreach ($stack as $line) {
                if ($count < 0 &&
                    (!array_key_exists('file', $line) ||
                        !array_key_exists('line', $line) ||
                        $line['file'] !== $errfile ||
                        $line['line'] !== $errline
                    )
                ) {
                    continue;
                } elseif (array_key_exists('file', $line) &&
                          $line['file'] === $errfile && $line['line'] === $errline
                ) {
                    $count++;
                    continue;
                }

                $source = '';

                if (array_key_exists(self::LINE_CLASS, $line)) {
                    $source .= $line[self::LINE_CLASS];
                }
                if (array_key_exists('type', $line)) {
                    $source .= $line['type'];
                }
                if (array_key_exists(self::LINE_FUNCTION, $line)) {
                    $source .= $line[self::LINE_FUNCTION];
                }
                if (array_key_exists(self::LINE_CLASS, $line) &&
                    array_key_exists('type', $line) &&
                    array_key_exists(self::LINE_FUNCTION, $line) &&
                    array_key_exists('args', $line) &&
                    is_array($line['args']) &&
                    count($line['args']) > 0 &&
                    $line[self::LINE_CLASS] == 'nabu\\core\\CNabuPluginManager' &&
                    $line[self::LINE_FUNCTION] == 'invoqueCommand'
                ) {
                    $source .= ' calling command ['.$line['args'][0].']';
                }
                if (array_key_exists('file', $line)) {
                    $source .= ' in '.$line['file'];
                }
                if (array_key_exists('line', $line)) {
                    $source .= " [line:$line[line]]";
                }

                $this->nb_engine->errorLog("#$count     at $source");

                $count++;
            }
            $count++;
        } while ($count < 1);
    }
public function dumpStack(
        string $message = null,
        string $type = null,
        string $errfile = null,
        int $errline = null,
        $errcontext = null,
        array $stack = null
    ) {
        global $NABU_MESSAGE_TYPE_NAME;

        if (($errtype = nb_getArrayValueByKey($type, $NABU_MESSAGE_TYPE_NAME)) === null) {
            $this->nb_engine->errorLog("Unknow error type [$type]: $message in $errfile [line:$errline]");
        } else {
            $this->nb_engine->errorLog("$errtype: $message in $errfile [line:$errline]");
        }

        if ($stack === null) {
            $stack = debug_backtrace(true);
        }
        $count = -1;

        do {
            foreach ($stack as $line) {
                if ($count < 0 &&
                    (!array_key_exists('file', $line) ||
                        !array_key_exists('line', $line) ||
                        $line['file'] !== $errfile ||
                        $line['line'] !== $errline
                    )
                ) {
                    continue;
                } elseif (array_key_exists('file', $line) &&
                          $line['file'] === $errfile && $line['line'] === $errline
                ) {
                    $count++;
                    continue;
                }

                $source = '';

                if (array_key_exists(self::LINE_CLASS, $line)) {
                    $source .= $line[self::LINE_CLASS];
                }
                if (array_key_exists('type', $line)) {
                    $source .= $line['type'];
                }
                if (array_key_exists(self::LINE_FUNCTION, $line)) {
                    $source .= $line[self::LINE_FUNCTION];
                }
                if (array_key_exists(self::LINE_CLASS, $line) &&
                    array_key_exists('type', $line) &&
                    array_key_exists(self::LINE_FUNCTION, $line) &&
                    array_key_exists('args', $line) &&
                    is_array($line['args']) &&
                    count($line['args']) > 0 &&
                    $line[self::LINE_CLASS] == 'nabu\\core\\CNabuPluginManager' &&
                    $line[self::LINE_FUNCTION] == 'invoqueCommand'
                ) {
                    $source .= ' calling command ['.$line['args'][0].']';
                }
                if (array_key_exists('file', $line)) {
                    $source .= ' in '.$line['file'];
                }
                if (array_key_exists('line', $line)) {
                    $source .= " [line:$line[line]]";
                }

                $this->nb_engine->errorLog("#$count     at $source");

                $count++;
            }
            $count++;
        } while ($count < 1);
    }
public function dumpStack ( string $ message = null , string $ type = null , string $ errfile = null , int $ errline = null , $ errcontext = null , array $ stack = null ) { global $ NABU_MESSAGE_TYPE_NAME ; if ( ( $ errtype = nb_getArrayValueByKey ( $ type , $ NABU_MESSAGE_TYPE_NAME ) ) === null ) { $ this -> nb_engine -> errorLog ( "Unknow error type [$type]: $message in $errfile [line:$errline]" ) ; } else { $ this -> nb_engine -> errorLog ( "$errtype: $message in $errfile [line:$errline]" ) ; } if ( $ stack === null ) { $ stack = debug_backtrace ( true ) ; } $ count = - 1 ; do { foreach ( $ stack as $ line ) { if ( $ count < 0 && ( ! array_key_exists ( 'file' , $ line ) || ! array_key_exists ( 'line' , $ line ) || $ line [ 'file' ] !== $ errfile || $ line [ 'line' ] !== $ errline ) ) { continue ; } elseif ( array_key_exists ( 'file' , $ line ) && $ line [ 'file' ] === $ errfile && $ line [ 'line' ] === $ errline ) { $ count ++ ; continue ; } $ source = '' ; if ( array_key_exists ( self :: LINE_CLASS , $ line ) ) { $ source .= $ line [ self :: LINE_CLASS ] ; } if ( array_key_exists ( 'type' , $ line ) ) { $ source .= $ line [ 'type' ] ; } if ( array_key_exists ( self :: LINE_FUNCTION , $ line ) ) { $ source .= $ line [ self :: LINE_FUNCTION ] ; } if ( array_key_exists ( self :: LINE_CLASS , $ line ) && array_key_exists ( 'type' , $ line ) && array_key_exists ( self :: LINE_FUNCTION , $ line ) && array_key_exists ( 'args' , $ line ) && is_array ( $ line [ 'args' ] ) && count ( $ line [ 'args' ] ) > 0 && $ line [ self :: LINE_CLASS ] == 'nabu\\core\\CNabuPluginManager' && $ line [ self :: LINE_FUNCTION ] == 'invoqueCommand' ) { $ source .= ' calling command [' . $ line [ 'args' ] [ 0 ] . ']' ; } if ( array_key_exists ( 'file' , $ line ) ) { $ source .= ' in ' . $ line [ 'file' ] ; } if ( array_key_exists ( 'line' , $ line ) ) { $ source .= " [line:$line[line]]" ; } $ this -> nb_engine -> errorLog ( "#$count     at $source" ) ; $ count ++ ; } $ count ++ ; } while ( $ count < 1 ) ; }
Analizes and creates a Stack sequence of call from the beginning of the execution
until the point of error and log each step in the Engine Log store.
@global string $NABU_MESSAGE_TYPE_NAME
@param string|null $message Error message
@param string|null $type Error type/level
@param string|null $errfile File name where the error was generated
@param int|null $errline File line where the error was generated
@param mixed|null $errcontext Matrix as described in {@see http://php.net/manual/en/function.set-error-handler.php}
@param array|null $stack Complete list of stack calls from the beginning of the execution until the point of error
Analizes and creates a Stack sequence of call from the beginning of the execution until the point of error and log each step in the Engine Log store .