35 $this->logger = $logger;
49 function sendNotice($msg, $dep_version, $backtrace_level = 1) {
55 $elgg_version_arr = explode(
'.', $elgg_version);
56 $elgg_major_version = (int)$elgg_version_arr[0];
57 $elgg_minor_version = (int)$elgg_version_arr[1];
59 $dep_version_arr = explode(
'.', (
string)$dep_version);
60 $dep_major_version = (int)$dep_version_arr[0];
61 $dep_minor_version = (int)$dep_version_arr[1];
63 $msg =
"Deprecated in $dep_major_version.$dep_minor_version: $msg Called from ";
68 $backtrace = debug_backtrace();
70 array_shift($backtrace);
71 $i = count($backtrace);
73 foreach ($backtrace as $trace) {
74 $stack[] =
"[#$i] {$trace['file']}:{$trace['line']}";
77 if ($backtrace_level > 0) {
78 if ($backtrace_level <= 1) {
85 $msg .= implode(
"<br /> -> ", $stack);
87 $this->logger->warn($msg);
sendNotice($msg, $dep_version, $backtrace_level=1)
Sends a notice about deprecated use of a function, view, etc.
__construct(\ElggSession $session, Logger $logger)
Constructor.
elgg_get_version($human_readable=false)
Get the current Elgg version information.