diff options
author | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-05-19 20:45:57 +0200 |
---|---|---|
committer | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-05-19 20:45:57 +0200 |
commit | b66e5840006078112b8da741b2c612e446afd452 (patch) | |
tree | a7067fa152428b3c0b41cae8435a94997167bacb /inc/infoutils.php | |
parent | c8d7c9382a31eaccc516f088312894797f4fe4bb (diff) | |
parent | 54b26fbe1e0f9efaba143d88ea8581933f5c8dc8 (diff) | |
download | rpg-b66e5840006078112b8da741b2c612e446afd452.tar.gz rpg-b66e5840006078112b8da741b2c612e446afd452.tar.bz2 |
Merge remote-tracking branch 'origin/master' into trailingcolons
Conflicts:
lib/plugins/usermanager/lang/nl/intro.txt
Diffstat (limited to 'inc/infoutils.php')
-rw-r--r-- | inc/infoutils.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/inc/infoutils.php b/inc/infoutils.php index 4faaee8ef..db856141f 100644 --- a/inc/infoutils.php +++ b/inc/infoutils.php @@ -394,6 +394,32 @@ function dbglog($msg,$header=''){ } /** + * Log accesses to deprecated fucntions to the debug log + * + * @param string $alternative The function or method that should be used instead + */ +function dbg_deprecated($alternative = '') { + global $conf; + if(!$conf['allowdebug']) return; + + $backtrace = debug_backtrace(); + array_shift($backtrace); + $self = array_shift($backtrace); + $call = array_shift($backtrace); + + $called = trim($self['class'].'::'.$self['function'].'()', ':'); + $caller = trim($call['class'].'::'.$call['function'].'()', ':'); + + $msg = $called.' is deprecated. It was called from '; + $msg .= $caller.' in '.$call['file'].':'.$call['line']; + if($alternative) { + $msg .= ' '.$alternative.' should be used instead!'; + } + + dbglog($msg); +} + +/** * Print a reversed, prettyprinted backtrace * * @author Gary Owen <gary_owen@bigfoot.com> |