aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2022-08-14 18:03:55 +0200
committerAndreas Gohr <andi@splitbrain.org>2022-08-14 18:03:55 +0200
commitc0ece86a0ac0cfab0856b056fb3ce8e726855542 (patch)
tree24993c0e9584de41b662a3c41c3ed4fcc9983f52
parent25edeeca14acaa318ea8f0009bd3a8f20921558f (diff)
downloaddokuwiki-c0ece86a0ac0cfab0856b056fb3ce8e726855542.tar.gz
dokuwiki-c0ece86a0ac0cfab0856b056fb3ce8e726855542.zip
Another fix for #3717
The deprecation mechanism did actually log the wrong file (callee instead of caller). This was fixed and the message adjusted again. A guardian for very short backtraces and large offsets was added
-rw-r--r--inc/Debug/DebugHelper.php6
-rw-r--r--lib/plugins/action.php2
-rw-r--r--lib/plugins/admin.php2
-rw-r--r--lib/plugins/auth.php2
-rw-r--r--lib/plugins/cli.php2
-rw-r--r--lib/plugins/remote.php2
-rw-r--r--lib/plugins/syntax.php2
7 files changed, 9 insertions, 9 deletions
diff --git a/inc/Debug/DebugHelper.php b/inc/Debug/DebugHelper.php
index a3f7a4de6..fb04c0374 100644
--- a/inc/Debug/DebugHelper.php
+++ b/inc/Debug/DebugHelper.php
@@ -46,7 +46,7 @@ class DebugHelper
$backtrace = debug_backtrace();
for ($i = 0; $i < $callerOffset; $i += 1) {
- array_shift($backtrace);
+ if(count($backtrace) > 1) array_shift($backtrace);
}
list($self, $call) = $backtrace;
@@ -64,8 +64,8 @@ class DebugHelper
trim(
(!empty($call['class']) ? ($call['class'] . '::') : '') .
$call['function'] . '()', ':'),
- $self['file'],
- $self['line']
+ $call['file'],
+ $call['line']
);
}
diff --git a/lib/plugins/action.php b/lib/plugins/action.php
index fec37497c..2ac2064ea 100644
--- a/lib/plugins/action.php
+++ b/lib/plugins/action.php
@@ -1,4 +1,4 @@
<?php
\dokuwiki\Debug\DebugHelper::dbgDeprecatedFunction(
- 'Do not require() files yourself. Autoloading', 1
+ 'Autoloading', 0, 'require(' . basename(__FILE__) . ')'
);
diff --git a/lib/plugins/admin.php b/lib/plugins/admin.php
index fec37497c..2ac2064ea 100644
--- a/lib/plugins/admin.php
+++ b/lib/plugins/admin.php
@@ -1,4 +1,4 @@
<?php
\dokuwiki\Debug\DebugHelper::dbgDeprecatedFunction(
- 'Do not require() files yourself. Autoloading', 1
+ 'Autoloading', 0, 'require(' . basename(__FILE__) . ')'
);
diff --git a/lib/plugins/auth.php b/lib/plugins/auth.php
index fec37497c..2ac2064ea 100644
--- a/lib/plugins/auth.php
+++ b/lib/plugins/auth.php
@@ -1,4 +1,4 @@
<?php
\dokuwiki\Debug\DebugHelper::dbgDeprecatedFunction(
- 'Do not require() files yourself. Autoloading', 1
+ 'Autoloading', 0, 'require(' . basename(__FILE__) . ')'
);
diff --git a/lib/plugins/cli.php b/lib/plugins/cli.php
index fec37497c..2ac2064ea 100644
--- a/lib/plugins/cli.php
+++ b/lib/plugins/cli.php
@@ -1,4 +1,4 @@
<?php
\dokuwiki\Debug\DebugHelper::dbgDeprecatedFunction(
- 'Do not require() files yourself. Autoloading', 1
+ 'Autoloading', 0, 'require(' . basename(__FILE__) . ')'
);
diff --git a/lib/plugins/remote.php b/lib/plugins/remote.php
index fec37497c..2ac2064ea 100644
--- a/lib/plugins/remote.php
+++ b/lib/plugins/remote.php
@@ -1,4 +1,4 @@
<?php
\dokuwiki\Debug\DebugHelper::dbgDeprecatedFunction(
- 'Do not require() files yourself. Autoloading', 1
+ 'Autoloading', 0, 'require(' . basename(__FILE__) . ')'
);
diff --git a/lib/plugins/syntax.php b/lib/plugins/syntax.php
index fec37497c..2ac2064ea 100644
--- a/lib/plugins/syntax.php
+++ b/lib/plugins/syntax.php
@@ -1,4 +1,4 @@
<?php
\dokuwiki\Debug\DebugHelper::dbgDeprecatedFunction(
- 'Do not require() files yourself. Autoloading', 1
+ 'Autoloading', 0, 'require(' . basename(__FILE__) . ')'
);