Skip to content

Commit a3a856e

Browse files
committedNov 25, 2021
Merge branch 'main' into topar-add-metadata-prop
2 parents 78a9535 + 65e3862 commit a3a856e

13 files changed

+121
-275
lines changed
 

‎.appveyor.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,35 @@ environment:
88
BIN_SDK_VER: 2.2.0
99
DEP: librdkafka-1.5.3
1010
matrix:
11-
- PHP_VER: 7.3
11+
- PHP_VER: 7.4
1212
TS: 0
1313
VC: vc15
1414
ARCH: x64
1515
OPCACHE: 0
16-
- PHP_VER: 7.3
16+
- PHP_VER: 7.4
1717
TS: 1
1818
VC: vc15
1919
ARCH: x64
2020
OPCACHE: 1
21-
- PHP_VER: 7.4
21+
- PHP_VER: 8.0
2222
TS: 0
23-
VC: vc15
23+
VC: vs16
2424
ARCH: x64
2525
OPCACHE: 0
26-
- PHP_VER: 7.4
26+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
27+
- PHP_VER: 8.0
2728
TS: 1
28-
VC: vc15
29+
VC: vs16
2930
ARCH: x64
3031
OPCACHE: 1
31-
- PHP_VER: 8.0
32+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
33+
- PHP_VER: 8.1
3234
TS: 0
3335
VC: vs16
3436
ARCH: x64
3537
OPCACHE: 0
3638
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
37-
- PHP_VER: 8.0
39+
- PHP_VER: 8.1
3840
TS: 1
3941
VC: vs16
4042
ARCH: x64

‎.github/workflows/test.yml

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,34 @@ jobs:
1212
strategy:
1313
matrix:
1414
include:
15-
- php: '8.0.0'
16-
librdkafka: 'v1.7.0'
15+
- php: '8.1.0'
16+
librdkafka: 'v1.8.2'
1717
memcheck: '1'
18-
- php: '8.0.0'
18+
- php: '8.1.0'
19+
librdkafka: 'v1.8.2'
20+
- php: '8.0.13'
21+
librdkafka: 'v1.8.2'
22+
- php: '7.4.26'
23+
librdkafka: 'v1.8.2'
24+
- php: '8.1.0'
1925
librdkafka: 'v1.7.0'
20-
- php: '7.4.0'
26+
- php: '8.0.13'
2127
librdkafka: 'v1.7.0'
22-
- php: '7.3.0'
28+
- php: '7.4.26'
2329
librdkafka: 'v1.7.0'
24-
- php: '8.0.0'
25-
librdkafka: 'v1.6.1'
26-
- php: '7.4.0'
27-
librdkafka: 'v1.6.1'
28-
- php: '7.3.0'
29-
librdkafka: 'v1.6.1'
30-
- php: '8.0.0'
31-
librdkafka: 'v1.5.3'
32-
- php: '7.4.0'
33-
librdkafka: 'v1.5.3'
34-
- php: '7.3.0'
35-
librdkafka: 'v1.5.3'
36-
- php: '8.0.0'
37-
librdkafka: 'v1.4.4'
38-
- php: '7.4.0'
39-
librdkafka: 'v1.4.4'
40-
- php: '7.3.0'
41-
librdkafka: 'v1.4.4'
42-
- php: '8.0.0'
30+
- php: '8.1.0'
31+
librdkafka: 'v1.6.2'
32+
- php: '8.0.13'
33+
librdkafka: 'v1.6.2'
34+
- php: '7.4.26'
35+
librdkafka: 'v1.6.2'
36+
- php: '8.1.0'
4337
librdkafka: 'master'
4438
experimental: true
45-
- php: '7.4.0'
39+
- php: '8.0.13'
4640
librdkafka: 'master'
4741
experimental: true
48-
- php: '7.3.0'
42+
- php: '7.4.26'
4943
librdkafka: 'master'
5044
experimental: true
5145

‎.github/workflows/test/build-librdkafka.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
set -ex
44

5-
if ! [ -f ~/build-cache/librdkafka/usr/local/include/librdkafka/rdkafka.h ] || ! [ -f ~/build-cache/librdkafka/usr/local/bin/kafkacat ]; then
5+
if ! [ -f ~/build-cache/librdkafka/usr/local/include/librdkafka/rdkafka.h ] || ! [ -f ~/build-cache/librdkafka/usr/local/bin/kcat ]; then
66
echo "librdkafka build is not cached"
77

8-
git clone --depth 1 --branch "${LIBRDKAFKA_VERSION:-1.5.0}" "${LIBRDKAFKA_REPOSITORY_URL:-https://github.com/edenhill/librdkafka.git}"
8+
git clone --depth 1 --branch "${LIBRDKAFKA_VERSION:-1.6.0}" "${LIBRDKAFKA_REPOSITORY_URL:-https://github.com/edenhill/librdkafka.git}"
99

1010
cd librdkafka
1111
./configure
@@ -18,9 +18,9 @@ if ! [ -f ~/build-cache/librdkafka/usr/local/include/librdkafka/rdkafka.h ] || !
1818
sudo ldconfig
1919
cd ..
2020

21-
git clone --depth 1 --branch "1.6.0" "${LIBRDKAFKA_REPOSITORY_URL:-https://github.com/edenhill/kafkacat.git}"
21+
git clone --depth 1 --branch "1.7.0" "${LIBRDKAFKA_REPOSITORY_URL:-https://github.com/edenhill/kcat.git}"
2222

23-
cd kafkacat
23+
cd kcat
2424
./configure
2525
make
2626
sudo make install DESTDIR=$HOME/build-cache/librdkafka

‎.github/workflows/test/start-kafka.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ printf "\n127.0.0.1 kafka\n"|sudo tee /etc/hosts >/dev/null
1010
echo "Waiting for Kafka to be ready"
1111

1212
for i in $(seq 1 20); do
13-
if kafkacat -b 127.0.0.1 -L; then
13+
if kcat -b 127.0.0.1 -L; then
1414
echo "Kafka is ready"
1515
exit 0
1616
fi

‎.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
*.lo
33
*.swp
44
.deps
5+
*.dep
56
.libs
67
Makefile
78
Makefile.fragments
@@ -14,16 +15,19 @@ build
1415
config.guess
1516
config.h
1617
config.h.in
18+
config.h.in~
1719
config.log
1820
config.nice
1921
config.status
2022
config.sub
2123
configure
2224
configure.in
25+
configure.ac
2326
include
2427
install-sh
2528
libtool
2629
ltmain.sh
30+
ltmain.sh.backup
2731
missing
2832
mkinstalldirs
2933
modules

‎README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# PHP Kafka extension (php-simple-kafka-client)
22

3-
[![Supported librdkafka versions: >= 1.4.0](https://img.shields.io/badge/librdkafka-%3E%3D%201.4.0-blue.svg)](https://github.com/edenhill/librdkafka/releases)
3+
[![Supported librdkafka versions: >= 1.6.0](https://img.shields.io/badge/librdkafka-%3E%3D%201.6.0-blue.svg)](https://github.com/edenhill/librdkafka/releases)
44
[![Supported Kafka versions: >= 0.9](https://img.shields.io/badge/kafka-%3E%3D%200.9-blue.svg)](https://github.com/edenhill/librdkafka/blob/master/INTRODUCTION.md#broker-version-compatibility)
55
![Supported Redpanda versions: >= 20.x](https://img.shields.io/badge/redpanda-%3E%3D20.x-red)
6-
![Supported PHP versions: 7.x .. 8.x](https://img.shields.io/badge/php-7.x%20..%208.x-blue.svg)
6+
![Supported PHP versions: 7.4 .. 8.x](https://img.shields.io/badge/php-7.4%20..%208.x-blue.svg)
77
[![License: BSD-3](https://img.shields.io/badge/License-BSD--3-green.svg)](https://github.com/php-kafka/php-simple-kafka-client/blob/main/LICENSE)
88
[![Join the chat at https://gitter.im/php-kafka/php-simple-kafka-client](https://badges.gitter.im/php-kafka/php-simple-kafka-client.svg)](https://gitter.im/php-kafka/php-simple-kafka-client?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
99

‎config.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ if test "$PHP_SIMPLE_KAFKA_CLIENT" != "no"; then
5555
yes
5656
#endif
5757
],[
58-
AC_MSG_RESULT([>= 1.4.0])
58+
AC_MSG_RESULT([>= 1.6.0])
5959
],[
60-
AC_MSG_ERROR([librdkafka version 1.4.0 or greater required.])
60+
AC_MSG_ERROR([librdkafka version 1.6.0 or greater required.])
6161
])
6262

6363
LDFLAGS="$ORIG_LDFLAGS"

‎configure.ac

Lines changed: 0 additions & 215 deletions
This file was deleted.

‎metadata_collection.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,15 @@
3939
#include "php_simple_kafka_client_int.h"
4040
#include "ext/spl/spl_iterators.h"
4141
#include "Zend/zend_interfaces.h"
42-
#include "metadata_collection_arginfo.h"
4342
#include "Zend/zend_exceptions.h"
4443

44+
#if PHP_VERSION_ID < 80100
45+
#define ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) \
46+
ZEND_BEGIN_ARG_INFO_EX(name, return_reference, required_num_args, allow_null)
47+
#endif
48+
49+
#include "metadata_collection_arginfo.h"
50+
4551
typedef struct _object_intern {
4652
zval zmetadata;
4753
const void *items;
@@ -248,7 +254,7 @@ void kafka_metadata_collection_init(INIT_FUNC_ARGS)
248254
INIT_NS_CLASS_ENTRY(tmpce, "SimpleKafkaClient\\Metadata", "Collection", class_SimpleKafkaClient_Metadata_Collection_methods);
249255
ce = zend_register_internal_class(&tmpce);
250256
ce->create_object = create_object;
251-
zend_class_implements(ce, 2, spl_ce_Countable, spl_ce_Iterator);
257+
zend_class_implements(ce, 2, zend_ce_countable, zend_ce_iterator);
252258

253259
handlers = kafka_default_object_handlers;
254260
handlers.get_debug_info = get_debug_info;

‎metadata_collection.stub.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ public function count(): int {}
1010

1111
public function rewind(): void {}
1212

13-
/** @return mixed */
14-
public function current() {}
13+
/** @tentative-return-type */
14+
public function current(): mixed {}
1515

1616
public function key(): int {}
1717

18-
/** @return mixed */
19-
public function next() {}
18+
/** @tentative-return-type */
19+
public function next(): void {}
2020

2121
public function valid(): bool {}
2222
}

‎metadata_collection_arginfo.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 925cbd1dcf14595ae437c111d3f99f767a665006 */
2+
* Stub hash: c130cfc464b41b677ecde96328b3417797b5176d */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_SimpleKafkaClient_Metadata_Collection_count, 0, 0, IS_LONG, 0)
55
ZEND_END_ARG_INFO()
66

77
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_SimpleKafkaClient_Metadata_Collection_rewind, 0, 0, IS_VOID, 0)
88
ZEND_END_ARG_INFO()
99

10-
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SimpleKafkaClient_Metadata_Collection_current, 0, 0, 0)
10+
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SimpleKafkaClient_Metadata_Collection_current, 0, 0, IS_MIXED, 0)
1111
ZEND_END_ARG_INFO()
1212

1313
#define arginfo_class_SimpleKafkaClient_Metadata_Collection_key arginfo_class_SimpleKafkaClient_Metadata_Collection_count
1414

15-
#define arginfo_class_SimpleKafkaClient_Metadata_Collection_next arginfo_class_SimpleKafkaClient_Metadata_Collection_current
15+
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SimpleKafkaClient_Metadata_Collection_next, 0, 0, IS_VOID, 0)
16+
ZEND_END_ARG_INFO()
1617

1718
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_SimpleKafkaClient_Metadata_Collection_valid, 0, 0, _IS_BOOL, 0)
1819
ZEND_END_ARG_INFO()

‎package.xml

Lines changed: 61 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
<email>coding.nikazu@gmail.com</email>
1111
<active>yes</active>
1212
</lead>
13-
<date>2021-04-12</date>
13+
<date>2021-08-04</date>
1414
<time>12:00:00</time>
1515
<version>
16-
<release>0.1.2</release>
16+
<release>0.1.4</release>
1717
<api>0.1.0</api>
1818
</version>
1919
<stability>
@@ -22,11 +22,10 @@
2222
</stability>
2323
<license uri="https://opensource.org/licenses/BSD-3-Clause">BSD-3 License</license>
2424
<notes>
25-
## Internals
26-
- add AppVeyor build (#39, @cmb69)
2725
## Bugfixes
28-
- version and test fixes (#35, #36, @remicollet)
29-
- fix windows build (#38, #40, @cmb69)
26+
- fix for PHP 8.1 (#54, @remicollet)
27+
## Internals
28+
- add all sources to package.xml (#54, @remicollet)
3029
</notes>
3130
<contents>
3231
<dir name="/">
@@ -37,34 +36,48 @@
3736
<file role="src" name="config.w32"/>
3837
<file role="src" name="configuration.c"/>
3938
<file role="src" name="configuration_arginfo.h"/>
39+
<file role="src" name="configuration.stub.php"/>
4040
<file role="src" name="consumer.c"/>
4141
<file role="src" name="consumer_arginfo.h"/>
42+
<file role="src" name="consumer.stub.php"/>
4243
<file role="src" name="functions.c"/>
4344
<file role="src" name="functions_arginfo.h"/>
45+
<file role="src" name="functions.stub.php"/>
4446
<file role="src" name="simple_kafka_client.c"/>
4547
<file role="src" name="simple_kafka_client_arginfo.h"/>
48+
<file role="src" name="simple_kafka_client.stub.php"/>
4649
<file role="src" name="kafka_exception.c"/>
4750
<file role="src" name="kafka_exception_arginfo.h"/>
51+
<file role="src" name="kafka_exception.stub.php"/>
4852
<file role="src" name="message.c"/>
4953
<file role="src" name="message_arginfo.h"/>
54+
<file role="src" name="message.stub.php"/>
5055
<file role="src" name="metadata.c"/>
5156
<file role="src" name="metadata_arginfo.h"/>
57+
<file role="src" name="metadata.stub.php"/>
5258
<file role="src" name="metadata_broker.c"/>
5359
<file role="src" name="metadata_broker_arginfo.h"/>
60+
<file role="src" name="metadata_broker.stub.php"/>
5461
<file role="src" name="metadata_collection.c"/>
5562
<file role="src" name="metadata_collection_arginfo.h"/>
63+
<file role="src" name="metadata_collection.stub.php"/>
5664
<file role="src" name="metadata_partition.c"/>
5765
<file role="src" name="metadata_partition_arginfo.h"/>
66+
<file role="src" name="metadata_partition.stub.php"/>
5867
<file role="src" name="metadata_topic.c"/>
5968
<file role="src" name="metadata_topic_arginfo.h"/>
69+
<file role="src" name="metadata_topic.stub.php"/>
6070
<file role="src" name="php_simple_kafka_client_int.h"/>
6171
<file role="src" name="producer.c"/>
6272
<file role="src" name="producer_arginfo.h"/>
73+
<file role="src" name="producer.stub.php"/>
6374
<file role="src" name="simple_kafka_client.c"/>
6475
<file role="src" name="topic.c"/>
6576
<file role="src" name="topic_arginfo.h"/>
77+
<file role="src" name="topic.stub.php"/>
6678
<file role="src" name="topic_partition.c"/>
6779
<file role="src" name="topic_partition_arginfo.h"/>
80+
<file role="src" name="topic_partition.stub.php"/>
6881
<dir name="tests">
6982
<file role="test" name="allow_null_payload.phpt"/>
7083
<file role="test" name="allow_null_payload_and_key.phpt"/>
@@ -90,7 +103,7 @@
90103
<dependencies>
91104
<required>
92105
<php>
93-
<min>7.3.0</min>
106+
<min>7.4.0</min>
94107
<max>8.99.99</max>
95108
</php>
96109
<pearinstaller>
@@ -101,6 +114,47 @@
101114
<providesextension>simple_kafka_client</providesextension>
102115
<extsrcrelease/>
103116
<changelog>
117+
<release>
118+
<date>2021-07-01</date>
119+
<time>12:00:00</time>
120+
<version>
121+
<release>0.1.3</release>
122+
<api>0.1.0</api>
123+
</version>
124+
<stability>
125+
<release>stable</release>
126+
<api>stable</api>
127+
</stability>
128+
<license uri="https://opensource.org/licenses/BSD-3-Clause">BSD-3 License</license>
129+
<notes>
130+
## Features
131+
- support oauthbearer mechanism (#47, #48, #49)
132+
## Bugfixes
133+
- fix for PHP 8.1 (#52)
134+
## Internals
135+
- cleanup and refactor (#43, #44, #45, #46)
136+
</notes>
137+
</release>
138+
<release>
139+
<date>2021-04-12</date>
140+
<time>12:00:00</time>
141+
<version>
142+
<release>0.1.2</release>
143+
<api>0.1.0</api>
144+
</version>
145+
<stability>
146+
<release>stable</release>
147+
<api>stable</api>
148+
</stability>
149+
<license uri="https://opensource.org/licenses/BSD-3-Clause">BSD-3 License</license>
150+
<notes>
151+
## Internals
152+
- add AppVeyor build (#39, @cmb69)
153+
## Bugfixes
154+
- version and test fixes (#35, #36, @remicollet)
155+
- fix windows build (#38, #40, @cmb69)
156+
</notes>
157+
</release>
104158
<release>
105159
<date>2021-04-11</date>
106160
<time>12:00:00</time>

‎php_simple_kafka_client_int.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ extern zend_object_handlers kafka_default_object_handlers;
147147

148148
#define phpext_kafka_ptr &simple_kafka_client_module_entry
149149

150-
#define PHP_SIMPLE_KAFKA_CLIENT_VERSION "0.1.2"
150+
#define PHP_SIMPLE_KAFKA_CLIENT_VERSION "0.1.4"
151151

152152

153153
static inline void kafka_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache, zval *retval, uint32_t param_count, zval params[])

0 commit comments

Comments
 (0)
Please sign in to comment.