kwn / php-rdkafka-stubs

Rdkafka extension stubs for your IDE. Always compatibile with the latest php-rdkafka version.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ext-rdkafka composer requirement

beriba opened this issue · comments

Is there any reason to not specify ext-rdkafka dependency version in composer? The change I recently made (adding setStatsCb method in RdKafka\Conf class) is specifically directed to ext-rdkafka version >=3.0.4. Currently people using this lib as a dependency may be misleaded that the above method always exist which is not true. This misunderstanding may also lead to different behaviour in local dev environment and in build environment due to not updated ext-rdkafka version in the latter one, which will probably crash during script execution instead of informing during dependency resolution. The same can also happen in production.

I also don't understand reason for required ext-rdkafka ((

+1
Because ext-rdkafka sometimes installed only on server, not in laptop used to coding.

Exactly. Coding is not just "making it work somehow". In real business it's also about finding potential bugs as fast as you can. It's cheaper to find and fix a bug during composer install on a build server than to find out about it when your application fails in production due to wrong extension version. In this particular case it will fail with "method not found" message which is not giving a single clue that it's failing because someone have older ext version. Composer will tell you that immediately. So instead wasting an hour or so looking for a bug you just install newer extension and you're ready to go. It's a single line in composer which does nothing wrong and can save hours of debugging

Hi guys, sorry for a late reply. Since release of the rdkafka 3.1 I decided to add the rdkafka extension requirement in composer.json. You can find it in kwn/php-rdkafka-stubs 1.3.0.