Giter VIP home page Giter VIP logo

php-rdkafka-stubs's Introduction

Stubs for PHP Rdkafka extension (4.0 version)

Build Status Latest Stable Version

This package provides you a set of stubs for RdKafka extension. It currently supports version 4.0. For older verisions of rdkafka extenstion (3.x and 0.9) please use version 1.x of this repository.

Installation

Add package to your composer.json dev dependencies

$ composer require kwn/php-rdkafka-stubs --dev

Usage

Once package is installed, your IDE should simply discover all stubs automatically. Please notice, that kwn/php-rdkafka-stubs package has no autoloader configuration provided, so stubs classes are visible in your IDE, but don't clashes with rdkafka extension namespaces.

php-rdkafka-stubs's People

Contributors

athaden avatar beriba avatar bibob7 avatar damianwadley avatar fahrenholz avatar joegreen88 avatar kmecnin avatar konstantincodes avatar kswzr avatar kwn avatar martynaszaliaduonis avatar mweibel avatar nick-zh avatar sfreezer avatar silentgecko avatar sokil avatar svnldwg avatar tony-sol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

php-rdkafka-stubs's Issues

ext-rdkafka composer requirement

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.

Missing nullable types for Message stub

We saw that when there is an error, and a message is consumed, there is possibility
to have null in message topic_name and message timestamp properties.
The exact error is -185 / RD_KAFKA_RESP_ERR__TIMED_OUT.
Probably it is a good idea to make them null-able. :)

Usage in PHPStorm

  1. download the zip or clone the repo
  2. Preferences > Languages & Frameworks > PHP > Include Path
  3. Add path to folder you download in Step1

Composer always shows an update is available

$ composer show kwn/php-rdkafka-stubs --latest
name     : kwn/php-rdkafka-stubs
descrip. : Rdkafka extension stubs for your IDE
keywords :
versions : * v2.2.1
latest   : 0.0.1
type     : library
license  : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText
homepage :
source   : [git] https://github.com/kwn/php-rdkafka-stubs.git 23b865d6b3e8fe1f080aa7371dc1da3339361996
dist     : [zip] https://api.github.com/repos/kwn/php-rdkafka-stubs/zipball/23b865d6b3e8fe1f080aa7371dc1da3339361996 23b865d6b3e8fe1f080aa7371dc1da3339361996
path     : /home/sites/vultr.com/vendor/kwn/php-rdkafka-stubs
names    : kwn/php-rdkafka-stubs

support
issues : https://github.com/kwn/php-rdkafka-stubs/issues
source : https://github.com/kwn/php-rdkafka-stubs/tree/v2.2.1

requires
ext-rdkafka >=4.0

requires (dev)
phpunit/phpunit ^8.2.4

Composer always shows that 0.0.1 is the latest version, even though I have v2.2.1 installed. I think switching between 0.x and v0.x is what's causing the issue

stub for RdKafka\Metadata\Broker does not exist

The broker object hasn't any stub and should probably have one, as does the topic object.

RdKafka\Metadata->getBrokers() return a Collection of Broker-Objects, which seem to have three methods:

  • getId()
  • getHost()
  • getPort()

Maybe there are other methods to describe too.

Error while installing stubs

After `php composer' of the composer json
this is the error.
Any idea why this happens?


  Problem 1
    - Installation request for kwn/php-rdkafka-stubs ^0.0.4 -> satisfiable by kwn/php-rdkafka-stubs[0.0.4].
    - kwn/php-rdkafka-stubs 0.0.4 requires ext-rdkafka ^0.9.1 -> the requested PHP extension rdkafka has the wrong version (2.0.1) installed.

  To enable extensions, verify that they are enabled in your .ini files:
    - /usr/local/etc/php/7.1/php.ini
    - /usr/local/etc/php/7.1/conf.d/ext-rdkafka.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.