Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksejs Cikuns <aleksejs.cikuns@zabbix.com>2022-03-03 14:50:47 +0300
committerAleksejs Cikuns <aleksejs.cikuns@zabbix.com>2022-03-03 14:50:47 +0300
commit272921f3e8d5f68d1d0847b7ddbfb0fcf2a34300 (patch)
tree62d94cb728ba740d48cf2f6d8c5a8d2c32d2f9ec
parent10ba2b366f15b5fb6dd61288ac0ab99ccd3fe4d8 (diff)
parent4cb386ec215230bcd02fea3aeeb48302b6e471e1 (diff)
..F....... [ZBXNEXT-7485] fixed debug_backtrace function usage for php8
* commit '4cb386ec215230bcd02fea3aeeb48302b6e471e1': ..F....... [ZBXNEXT-7485] reverted dubug.inc.php changes .......... [ZBXNEXT-7485] added changelog file .......... [ZBXNEXT-7485] added changelog file .......... [ZBXNEXT-7485] added changelog file A.F....... [ZBXNEXT-7485] fixed debug_backtrace function usage for php8
-rw-r--r--ChangeLog.d/feature/ZBXNEXT-74851
-rw-r--r--ui/include/classes/debug/CProfiler.php8
-rw-r--r--ui/tests/templates/zabbix.conf.php2
3 files changed, 6 insertions, 5 deletions
diff --git a/ChangeLog.d/feature/ZBXNEXT-7485 b/ChangeLog.d/feature/ZBXNEXT-7485
new file mode 100644
index 00000000000..21f66f42b1d
--- /dev/null
+++ b/ChangeLog.d/feature/ZBXNEXT-7485
@@ -0,0 +1 @@
+A.F....... [ZBXNEXT-7485] fixed debug_backtrace function usage for php8 (acikuns)
diff --git a/ui/include/classes/debug/CProfiler.php b/ui/include/classes/debug/CProfiler.php
index cdcf4bf326a..53ac4507914 100644
--- a/ui/include/classes/debug/CProfiler.php
+++ b/ui/include/classes/debug/CProfiler.php
@@ -258,7 +258,7 @@ class CProfiler {
$this->sqlQueryLog[] = [
$time,
$sql,
- array_slice(debug_backtrace(), 1)
+ array_slice(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), 1)
];
}
@@ -271,7 +271,7 @@ class CProfiler {
* @param array $result
*/
public function profileApiCall($class, $method, array $params, $result) {
- $backtrace = debug_backtrace();
+ $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
// Use the file name and line number from the first call to the API wrapper object.
// Due to a bug earlier versions of PHP 5.3 did not provide the file name and line number
@@ -317,7 +317,7 @@ class CProfiler {
$method,
$endpoint,
$query,
- array_slice(debug_backtrace(), 1)
+ array_slice(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), 1)
];
}
@@ -342,7 +342,7 @@ class CProfiler {
*/
public function formatCallStack(array $callStack = null) {
if (!$callStack) {
- $callStack = debug_backtrace(false);
+ $callStack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
// never show the call to this method
array_shift($callStack);
diff --git a/ui/tests/templates/zabbix.conf.php b/ui/tests/templates/zabbix.conf.php
index b44d90f80f2..23eb8a125a5 100644
--- a/ui/tests/templates/zabbix.conf.php
+++ b/ui/tests/templates/zabbix.conf.php
@@ -36,7 +36,7 @@ if (!defined('PHPUNIT_BASEDIR')) {
}
function formatCallStack() {
- $calls = debug_backtrace(0);
+ $calls = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
// never show the call to this method
array_shift($calls);