public function get_array() { return array( 'level' => $this->level, 'message' => $this->message, '_file' => wpi_truncate_path($this->_file), '_line' => $this->_line, '_func' => $this->_func.'()' ); }
/** * Fish out the relevant lines from the debug backtrace * * @param array $backtrace * @param string $from * @param string $find * @return array */ function wpi_extract_backtrace($backtrace, $from = 'next', $find = '|^(_deprecated)|') { $halt_on_next = $file = $line = false; foreach ($backtrace as $step) { if ($halt_on_next) { $_func = $step['function']; $_file = wpi_truncate_path($step['file']); $_line = $step['line']; break; } if (preg_match($find, $step['function'])) { if ($from == 'next') { $halt_on_next = true; } elseif ($from == 'current') { $_func = $step['function']; $_file = wpi_truncate_path($step['file']); $_line = $step['line']; break; } } } // last ditch effort. Janky? Yes. Functional? Mostly. if (empty($_line) && $find != '|^(_deprecated)|') { $file_args = wpi_extract_backtrace($backtrace); extract($file_args); } return compact('_file', '_line', '_func'); }