diff --git a/inc/TarLib.class.php b/inc/TarLib.class.php index ae08039ecc1611f4c10c636132629309475c94db..dd319a79aedc1097427e3c7fd848574fda1ad44e 100644 --- a/inc/TarLib.class.php +++ b/inc/TarLib.class.php @@ -26,6 +26,8 @@ class TarLib { public $_result = true; function __construct($file, $comptype = TarLib::COMPRESS_AUTO, $complevel = 9) { + dbg_deprecated('class Tar'); + if(!$file) $this->error('__construct', '$file'); $this->file = $file; diff --git a/inc/changelog.php b/inc/changelog.php index de06c9683e0d31bf3414a289ae2bbffc4746b34f..f0788d8961e9a00f20c5b5e9fc9dd7f8c7bb3f45 100644 --- a/inc/changelog.php +++ b/inc/changelog.php @@ -1004,12 +1004,13 @@ class MediaChangelog extends ChangeLog { * changelog files, only the chunk containing the * requested changelog line is read. * - * @deprecated 20-11-2013 + * @deprecated 2013-11-20 * * @author Ben Coburn <btcoburn@silicodon.net> * @author Kate Arzamastseva <pshns@ukr.net> */ function getRevisionInfo($id, $rev, $chunk_size = 8192, $media = false) { + dbg_deprecated('class PageChangeLog or class MediaChanglog'); if($media) { $changelog = new MediaChangeLog($id, $chunk_size); } else { @@ -1036,12 +1037,13 @@ function getRevisionInfo($id, $rev, $chunk_size = 8192, $media = false) { * backwards in chunks until the requested number of changelog * lines are recieved. * - * @deprecated 20-11-2013 + * @deprecated 2013-11-20 * * @author Ben Coburn <btcoburn@silicodon.net> * @author Kate Arzamastseva <pshns@ukr.net> */ function getRevisions($id, $first, $num, $chunk_size = 8192, $media = false) { + dbg_deprecated('class PageChangeLog or class MediaChanglog'); if($media) { $changelog = new MediaChangeLog($id, $chunk_size); } else { diff --git a/inc/infoutils.php b/inc/infoutils.php index 0992040d97f29dd30fc883167ff42f2444b953a3..80732371582849ed07536931ca6f57b41691c21c 100644 --- a/inc/infoutils.php +++ b/inc/infoutils.php @@ -383,6 +383,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 * diff --git a/inc/plugin.php b/inc/plugin.php index 7de4fbd74ff2deb62a5b01601b36817181d7c103..e0112ef5684208412decff2972b21c9637933a3f 100644 --- a/inc/plugin.php +++ b/inc/plugin.php @@ -252,6 +252,7 @@ class DokuWiki_Plugin { */ function __call($name, $arguments) { if($name == 'render'){ + dbg_deprecated('render_text()'); if(!isset($arguments[1])) $arguments[1] = 'xhtml'; return $this->render_text($arguments[0], $arguments[1]); } diff --git a/inc/subscription.php b/inc/subscription.php index 298e7c12bb29c6f405f5174c05c604260623b319..a6f3dec44acda1bc463d18b8685b2756d314ddfb 100644 --- a/inc/subscription.php +++ b/inc/subscription.php @@ -700,6 +700,7 @@ class Subscription { * @deprecated 2012-12-07 */ function subscription_addresslist(&$data) { + dbg_deprecated('class Subscription'); $sub = new Subscription(); $sub->notifyaddresses($data); }