Skip to content

Commit a71fd09

Browse files
committed
make check more safe
1 parent 07c0fb7 commit a71fd09

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: pkg/rdkafka/RdKafkaProducer.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ public function send(Destination $destination, Message $message): void
4747
// Headers in payload are maintained for backwards compatibility with apps that might run on lower phprdkafka version
4848
if (method_exists($topic, 'producev')) {
4949
// Phprdkafka <= 3.1.0 will fail calling `producev` on librdkafka >= 1.0.0 causing segfault
50-
if (version_compare(RdKafkaContext::getLibrdKafkaVersion(), '1.0.0', '>=')
50+
// Since we are forcing to use at least librdkafka:1.0.0, no need to check the lib version anymore
51+
if (false !== phpversion('rdkafka')
5152
&& version_compare(phpversion('rdkafka'), '3.1.0', '<=')) {
5253
trigger_error(
5354
'Phprdkafka <= 3.1.0 is incompatible with librdkafka 1.0.0 when calling `producev`. '.

0 commit comments

Comments
 (0)