Skip to content

Commit 73b47b2

Browse files
committed
fix(agent): check if Channel class exists before trying to manually load it
1 parent 268c28b commit 73b47b2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

agent/lib_php_amqplib.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,12 @@
9191
static void nr_php_amqplib_ensure_class() {
9292
int result = FAILURE;
9393

94-
result = zend_eval_string("class_exists('PhpAmqpLib\\Channel\\AMQPChannel');",
95-
NULL, "Get nr_php_amqplib_class_exists");
94+
class_entry = nr_php_find_class("phpamqplib\\channel\\amqpchannel");
95+
if (NULL == class_entry) {
96+
result
97+
= zend_eval_string("class_exists('PhpAmqpLib\\Channel\\AMQPChannel');",
98+
NULL, "Get nr_php_amqplib_class_exists");
99+
}
96100
/*
97101
* We don't need to check anything else at this point. If this fails, there's
98102
* nothing else we can do anyway.

0 commit comments

Comments
 (0)