|
| 1 | +# Project Overview |
| 2 | + |
| 3 | +## Directory overview |
| 4 | + |
| 5 | +* __/benchmarks__ - phpbench based benchmark tests |
| 6 | +* __/docs__ - docs dir (markdown) |
| 7 | +* __/examples__ - example scripts |
| 8 | +* __/resources__ |
| 9 | + * __/benchmarks__ ansible playbooks setup and run benchmarks |
| 10 | + * __/docker__ |
| 11 | + * __/php74-librdkafka-ffi__ - dockerfile for PHP 7.4 image with librdkafka and ffi & rdkafka ext (based |
| 12 | + on [php:7.4-cli](https://hub.docker.com/_/php) ) |
| 13 | + * __/php80-librdkafka-ffi__ - dockerfile for PHP 8.0 image with librdkafka and ffi & rdkafka ext (based |
| 14 | + on [php:8.0-rc-cli](https://hub.docker.com/_/php) ) |
| 15 | + * __/docs__ - scripts to build documentation site from /docs |
| 16 | + * __/ffigen__ - config to build low level library bindings |
| 17 | + * __/phpunit__ - bootstrap and config for phpunit tests |
| 18 | + * __/test-extension__ - base dir for rdkafka ext compatibility tests |
| 19 | +* __/src__ - source dir |
| 20 | +* __/tests__ - tests dir |
| 21 | + |
| 22 | +## Docker Images for Development |
| 23 | + |
| 24 | +Build all images |
| 25 | + |
| 26 | + docker-compose build --no-cache --pull |
| 27 | + |
| 28 | +Alternative: build the image individually |
| 29 | + |
| 30 | + docker-compose build --no-cache --pull php74 php80 |
| 31 | + |
| 32 | +Alternative: build the image individually and set optional build args (LIBRDKAFKA_VERSION default = v1.5.3, RDKAFKA_EXT_VERSION default = |
| 33 | +4.1.x for php74 / 5.x for php80) |
| 34 | + |
| 35 | + docker-compose build --no-cache --pull --build-arg LIBRDKAFKA_VERSION="v1.5.3" --build-arg RDKAFKA_EXT_VERSION="4.1.1" php74 |
| 36 | + |
| 37 | +Test - should show latest 7.4 version |
| 38 | + |
| 39 | + docker-compose run php74 php -v |
| 40 | + |
| 41 | +Test - should show ```FFI``` in modules list |
| 42 | + |
| 43 | + docker-compose run php74 php -m |
| 44 | + |
| 45 | +Test ffi librdkafka binding - should show current version of librdkafka: |
| 46 | + |
| 47 | + docker-compose run php74 php examples/version.php |
| 48 | + |
| 49 | +Test - should show ```rdkafka``` in modules list |
| 50 | + |
| 51 | + docker-compose run php74 php -dextension=rdkafka.so -m |
| 52 | + |
| 53 | +## References |
| 54 | + |
| 55 | +* [FFI extension](https://www.php.net/manual/en/book.ffi.php) |
| 56 | +* [librdkafka ^1.0](https://github.com/edenhill/librdkafka) ([docs](https://docs.confluent.io/current/clients/librdkafka/rdkafka_8h.html)) |
| 57 | +* Confluent [Kafka](https://hub.docker.com/r/confluentinc/cp-kafka) / [Zookeeper](https://hub.docker.com/r/confluentinc/cp-zookeeper) docker |
| 58 | + images |
| 59 | +* [phpbench lib](https://github.com/phpbench/phpbench) for benchmarking |
0 commit comments