summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2014-05-18 20:12:53 +0200
committerAndreas Gohr <andi@splitbrain.org>2014-05-18 20:12:53 +0200
commit60bf39dd81584414d4cb6f8cf568330d1a843a93 (patch)
tree7757ea89895043d56e570501773f9bad9ff1b342
parent2e0c0440007c357cac9fbd8bed1a8b5ac9cab2a6 (diff)
parent1419a485e3ac0c507ef073f0b816bd41f7e4a5cd (diff)
downloadrpg-60bf39dd81584414d4cb6f8cf568330d1a843a93.tar.gz
rpg-60bf39dd81584414d4cb6f8cf568330d1a843a93.tar.bz2
Merge pull request #693 from splitbrain/logdeprecated
log deprecated function calls FS#2399
-rw-r--r--inc/TarLib.class.php2
-rw-r--r--inc/changelog.php6
-rw-r--r--inc/infoutils.php26
-rw-r--r--inc/plugin.php1
-rw-r--r--inc/subscription.php1
5 files changed, 34 insertions, 2 deletions
diff --git a/inc/TarLib.class.php b/inc/TarLib.class.php
index ae08039ec..dd319a79a 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 de06c9683..f0788d896 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 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>
diff --git a/inc/plugin.php b/inc/plugin.php
index 7de4fbd74..e0112ef56 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 298e7c12b..a6f3dec44 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);
}