28 $this->logger = $logger;
42 function sendNotice($msg, $dep_version, $backtrace_level = 1) {
44 $msg =
"Deprecated in $dep_version: $msg Called from ";
49 $backtrace = debug_backtrace();
51 array_shift($backtrace);
52 $i = count($backtrace);
54 foreach ($backtrace as $trace) {
55 if (empty($trace[
'file'])) {
57 $stack[] =
"[#$i] unknown";
59 $stack[] =
"[#$i] {$trace['file']}:{$trace['line']}";
64 if ($backtrace_level > 0) {
65 if ($backtrace_level <= 1) {
72 $msg .= implode(
"<br /> -> ", $stack);
74 $this->logger->warn($msg);
sendNotice($msg, $dep_version, $backtrace_level=1)
Sends a notice about deprecated use of a function, view, etc.
__construct(Logger $logger)
Constructor.