Skip to content

Commit

Permalink
Drop unsupported php versions and old librdkafka versions (#559)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-lb authored Oct 24, 2024
1 parent 1d73741 commit 78a06df
Show file tree
Hide file tree
Showing 66 changed files with 126 additions and 1,713 deletions.
18 changes: 10 additions & 8 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,37 @@ environment:
BIN_SDK_VER: 2.2.0
DEP: librdkafka-1.5.3
matrix:
- PHP_VER: 7.4
- PHP_VER: 8.1
TS: 0
VC: vc15
VC: vs16
ARCH: x64
OPCACHE: 0
- PHP_VER: 7.4
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- PHP_VER: 8.1
TS: 1
VC: vc15
VC: vs16
ARCH: x64
OPCACHE: 1
- PHP_VER: 8.0
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- PHP_VER: 8.2
TS: 0
VC: vs16
ARCH: x64
OPCACHE: 0
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- PHP_VER: 8.0
- PHP_VER: 8.2
TS: 1
VC: vs16
ARCH: x64
OPCACHE: 1
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- PHP_VER: 8.1
- PHP_VER: 8.3
TS: 0
VC: vs16
ARCH: x64
OPCACHE: 0
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- PHP_VER: 8.1
- PHP_VER: 8.3
TS: 1
VC: vs16
ARCH: x64
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ on:
jobs:
package:
name: 'Package'
runs-on: 'ubuntu-20.04'
runs-on: 'ubuntu-24.04'
steps:
- name: 'Check out repository'
uses: 'actions/checkout@v2'
with:
path: 'php-rdkafka'

- name: 'Install dependencies'
run: 'sudo apt-get -y install php7.4-dev librdkafka-dev'
run: 'sudo apt-get -y install php-dev librdkafka-dev'

- name: 'Package and verify package'
run: './php-rdkafka/.github/workflows/package/package.sh'
Expand Down
99 changes: 6 additions & 93 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:
include:
# Latest librdkafka 2.x with memcheck
- php: '8.3.0'
librdkafka: 'v1.9.2'
librdkafka: 'v2.6.0'
memcheck: '1'
- php: '8.2.0'
librdkafka: 'v1.9.2'
librdkafka: 'v2.6.0'
memcheck: '1'
- php: '8.1.0'
librdkafka: 'v1.9.2'
librdkafka: 'v2.6.0'
memcheck: '1'

# Latest librdkafka 1.x with memcheck
Expand All @@ -36,17 +36,14 @@ jobs:
- php: '8.1.0'
librdkafka: 'v1.9.2'
memcheck: '1'
- php: '8.0.0'
librdkafka: 'v1.9.2'
memcheck: '1'

# Latest librdkafka 2.x
- php: '8.3.0'
librdkafka: 'v2.3.0'
librdkafka: 'v2.6.0'
- php: '8.2.0'
librdkafka: 'v2.3.0'
librdkafka: 'v2.6.0'
- php: '8.1.0'
librdkafka: 'v2.3.0'
librdkafka: 'v2.6.0'

# Latest librdkafka 1.x
- php: '8.3.0'
Expand All @@ -55,12 +52,6 @@ jobs:
librdkafka: 'v1.9.2'
- php: '8.1.0'
librdkafka: 'v1.9.2'
- php: '8.0.0'
librdkafka: 'v1.9.2'
- php: '7.4.0'
librdkafka: 'v1.9.2'
- php: '7.3.0'
librdkafka: 'v1.9.2'

# librdkafka 1.7.0
- php: '8.3.0'
Expand All @@ -69,79 +60,10 @@ jobs:
librdkafka: 'v1.7.0'
- php: '8.1.0'
librdkafka: 'v1.7.0'
- php: '8.0.0'
librdkafka: 'v1.7.0'
- php: '7.4.0'
librdkafka: 'v1.7.0'
- php: '7.3.0'
librdkafka: 'v1.7.0'

# librdkafka 1.6.1
- php: '8.1.0'
librdkafka: 'v1.6.1'
- php: '8.0.0'
librdkafka: 'v1.6.1'
- php: '7.4.0'
librdkafka: 'v1.6.1'
- php: '7.3.0'
librdkafka: 'v1.6.1'

# librdkafka 1.5.3
- php: '8.1.0'
librdkafka: 'v1.5.3'
- php: '8.0.0'
librdkafka: 'v1.5.3'
- php: '7.4.0'
librdkafka: 'v1.5.3'
- php: '7.3.0'
librdkafka: 'v1.5.3'

# librdkafka 1.4.4
- php: '8.1.0'
librdkafka: 'v1.4.4'
- php: '8.0.0'
librdkafka: 'v1.4.4'
- php: '7.4.0'
librdkafka: 'v1.4.4'
- php: '7.3.0'
librdkafka: 'v1.4.4'

# librdkafka 1.0.1
- php: '8.1.0'
librdkafka: 'v1.0.1'
skipoauth: '1'
- php: '8.0.0'
librdkafka: 'v1.0.1'
skipoauth: '1'
- php: '7.4.0'
librdkafka: 'v1.0.1'
skipoauth: '1'
- php: '7.3.0'
librdkafka: 'v1.0.1'
skipoauth: '1'

# librdkafka 0.11.6
- php: '8.1.0'
librdkafka: 'v0.11.6'
skipoauth: '1'
- php: '8.0.0'
librdkafka: 'v0.11.6'
skipoauth: '1'
- php: '7.4.0'
librdkafka: 'v0.11.6'
skipoauth: '1'
- php: '7.3.0'
librdkafka: 'v0.11.6'
skipoauth: '1'
- php: '7.2.0'
librdkafka: 'v0.11.6'
skipoauth: '1'
- php: '7.1.0'
librdkafka: 'v0.11.6'
skipoauth: '1'
- php: '7.0.0'
librdkafka: 'v0.11.6'
skipoauth: '1'

# librdkafka master (experimental, does not block PRs)
- php: '8.3.0'
Expand All @@ -153,15 +75,6 @@ jobs:
- php: '8.1.0'
librdkafka: 'master'
experimental: true
- php: '8.0.0'
librdkafka: 'master'
experimental: true
- php: '7.4.0'
librdkafka: 'master'
experimental: true
- php: '7.3.0'
librdkafka: 'master'
experimental: true

runs-on: 'ubuntu-20.04'
continue-on-error: ${{ !!matrix.experimental }}
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/test/build-php.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,7 @@ if ! [ -f ~/build-cache/php/usr/local/bin/php ]; then
if [ $MEMORY_CHECK -eq 1 ]; then
PHP_BUILD_FLAGS="$PHP_BUILD_FLAGS --enable-debug --with-valgrind"
else
case $PHP_VERSION in
8.*)
PHP_BUILD_FLAGS="$PHP_BUILD_FLAGS --enable-zts"
;;
7.*)
PHP_BUILD_FLAGS="$PHP_BUILD_FLAGS --enable-maintainer-zts"
;;
esac
PHP_BUILD_FLAGS="$PHP_BUILD_FLAGS --enable-zts"
fi

./configure $PHP_BUILD_FLAGS $PHP_BUILD_EXTRA_FLAGS
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.la
*.lo
*.swp
*_legacy_arginfo.h
.deps
.libs
Makefile
Expand Down
8 changes: 0 additions & 8 deletions conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@
#include "conf.h"
#include "topic_partition.h"
#include "message.h"
#if PHP_VERSION_ID < 80000
#include "conf_legacy_arginfo.h"
#else
#include "conf_arginfo.h"
#endif

zend_class_entry * ce_kafka_conf;
zend_class_entry * ce_kafka_topic_conf;
Expand Down Expand Up @@ -735,7 +731,6 @@ PHP_METHOD(RdKafka_Conf, setLogCb)
}
/* }}} */

#ifdef HAS_RD_KAFKA_OAUTHBEARER
/* {{{ proto void RdKafka\Conf::setOauthbearerTokenRefreshCb(mixed $callback)
Set token refresh callback for OAUTHBEARER sasl */
PHP_METHOD(RdKafka_Conf, setOauthbearerTokenRefreshCb)
Expand Down Expand Up @@ -767,7 +762,6 @@ PHP_METHOD(RdKafka_Conf, setOauthbearerTokenRefreshCb)
rd_kafka_conf_set_oauthbearer_token_refresh_cb(conf->u.conf, kafka_conf_set_oauthbearer_token_refresh_cb);
}
/* }}} */
#endif

/* {{{ proto RdKafka\TopicConf::__construct() */
PHP_METHOD(RdKafka_TopicConf, __construct)
Expand Down Expand Up @@ -816,14 +810,12 @@ PHP_METHOD(RdKafka_TopicConf, setPartitioner)
case MSG_PARTITIONER_CONSISTENT_RANDOM:
partitioner = rd_kafka_msg_partitioner_consistent_random;
break;
#ifdef HAS_RD_KAFKA_PARTITIONER_MURMUR2
case MSG_PARTITIONER_MURMUR2:
partitioner = rd_kafka_msg_partitioner_murmur2;
break;
case MSG_PARTITIONER_MURMUR2_RANDOM:
partitioner = rd_kafka_msg_partitioner_murmur2_random;
break;
#endif
default:
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "Invalid partitioner given");
return;
Expand Down
2 changes: 0 additions & 2 deletions conf.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ public function setOffsetCommitCb(callable $callback): void {}
/** @tentative-return-type */
public function setLogCb(callable $callback): void {}

#ifdef HAS_RD_KAFKA_OAUTHBEARER
/** @tentative-return-type */
public function setOauthbearerTokenRefreshCb(callable $callback): void {}
#endif
}

class TopicConf
Expand Down
39 changes: 7 additions & 32 deletions conf_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: a72d2e1796ed7f89185f543973c659a6a704f347 */
* Stub hash: 4bdaeef0f9a2a0194b1f800100ff14793cf6980a */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RdKafka_Conf___construct, 0, 0, 0)
ZEND_END_ARG_INFO()
Expand Down Expand Up @@ -48,15 +48,7 @@ ZEND_END_ARG_INFO()

#define arginfo_class_RdKafka_Conf_setLogCb arginfo_class_RdKafka_Conf_setErrorCb

#if defined(HAS_RD_KAFKA_OAUTHBEARER)
#if (PHP_VERSION_ID >= 80100)
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_RdKafka_Conf_setOauthbearerTokenRefreshCb, 0, 1, IS_VOID, 0)
#else
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RdKafka_Conf_setOauthbearerTokenRefreshCb, 0, 0, 1)
#endif
ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0)
ZEND_END_ARG_INFO()
#endif
#define arginfo_class_RdKafka_Conf_setOauthbearerTokenRefreshCb arginfo_class_RdKafka_Conf_setErrorCb

#define arginfo_class_RdKafka_TopicConf___construct arginfo_class_RdKafka_Conf___construct

Expand All @@ -72,6 +64,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RdKafka_TopicConf_setPartitioner, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, partitioner, IS_LONG, 0)
ZEND_END_ARG_INFO()


ZEND_METHOD(RdKafka_Conf, __construct);
ZEND_METHOD(RdKafka_Conf, dump);
ZEND_METHOD(RdKafka_Conf, set);
Expand All @@ -83,12 +76,11 @@ ZEND_METHOD(RdKafka_Conf, setRebalanceCb);
ZEND_METHOD(RdKafka_Conf, setConsumeCb);
ZEND_METHOD(RdKafka_Conf, setOffsetCommitCb);
ZEND_METHOD(RdKafka_Conf, setLogCb);
#if defined(HAS_RD_KAFKA_OAUTHBEARER)
ZEND_METHOD(RdKafka_Conf, setOauthbearerTokenRefreshCb);
#endif
ZEND_METHOD(RdKafka_TopicConf, __construct);
ZEND_METHOD(RdKafka_TopicConf, setPartitioner);


static const zend_function_entry class_RdKafka_Conf_methods[] = {
ZEND_ME(RdKafka_Conf, __construct, arginfo_class_RdKafka_Conf___construct, ZEND_ACC_PUBLIC)
ZEND_ME(RdKafka_Conf, dump, arginfo_class_RdKafka_Conf_dump, ZEND_ACC_PUBLIC)
Expand All @@ -101,24 +93,15 @@ static const zend_function_entry class_RdKafka_Conf_methods[] = {
ZEND_ME(RdKafka_Conf, setConsumeCb, arginfo_class_RdKafka_Conf_setConsumeCb, ZEND_ACC_PUBLIC)
ZEND_ME(RdKafka_Conf, setOffsetCommitCb, arginfo_class_RdKafka_Conf_setOffsetCommitCb, ZEND_ACC_PUBLIC)
ZEND_ME(RdKafka_Conf, setLogCb, arginfo_class_RdKafka_Conf_setLogCb, ZEND_ACC_PUBLIC)
#if defined(HAS_RD_KAFKA_OAUTHBEARER)
ZEND_ME(RdKafka_Conf, setOauthbearerTokenRefreshCb, arginfo_class_RdKafka_Conf_setOauthbearerTokenRefreshCb, ZEND_ACC_PUBLIC)
#endif
ZEND_FE_END
};


static const zend_function_entry class_RdKafka_TopicConf_methods[] = {
ZEND_ME(RdKafka_TopicConf, __construct, arginfo_class_RdKafka_TopicConf___construct, ZEND_ACC_PUBLIC)
#if (PHP_VERSION_ID >= 80400)
ZEND_RAW_FENTRY("dump", zim_RdKafka_Conf_dump, arginfo_class_RdKafka_TopicConf_dump, ZEND_ACC_PUBLIC, NULL, NULL)
#else
ZEND_RAW_FENTRY("dump", zim_RdKafka_Conf_dump, arginfo_class_RdKafka_TopicConf_dump, ZEND_ACC_PUBLIC)
#endif
#if (PHP_VERSION_ID >= 80400)
ZEND_RAW_FENTRY("set", zim_RdKafka_Conf_set, arginfo_class_RdKafka_TopicConf_set, ZEND_ACC_PUBLIC, NULL, NULL)
#else
ZEND_RAW_FENTRY("set", zim_RdKafka_Conf_set, arginfo_class_RdKafka_TopicConf_set, ZEND_ACC_PUBLIC)
#endif
ZEND_MALIAS(RdKafka_Conf, dump, dump, arginfo_class_RdKafka_TopicConf_dump, ZEND_ACC_PUBLIC)
ZEND_MALIAS(RdKafka_Conf, set, set, arginfo_class_RdKafka_TopicConf_set, ZEND_ACC_PUBLIC)
ZEND_ME(RdKafka_TopicConf, setPartitioner, arginfo_class_RdKafka_TopicConf_setPartitioner, ZEND_ACC_PUBLIC)
ZEND_FE_END
};
Expand All @@ -128,11 +111,7 @@ static zend_class_entry *register_class_RdKafka_Conf(void)
zend_class_entry ce, *class_entry;

INIT_NS_CLASS_ENTRY(ce, "RdKafka", "Conf", class_RdKafka_Conf_methods);
#if (PHP_VERSION_ID >= 80400)
class_entry = zend_register_internal_class_with_flags(&ce, NULL, 0);
#else
class_entry = zend_register_internal_class_ex(&ce, NULL);
#endif

return class_entry;
}
Expand All @@ -142,11 +121,7 @@ static zend_class_entry *register_class_RdKafka_TopicConf(void)
zend_class_entry ce, *class_entry;

INIT_NS_CLASS_ENTRY(ce, "RdKafka", "TopicConf", class_RdKafka_TopicConf_methods);
#if (PHP_VERSION_ID >= 80400)
class_entry = zend_register_internal_class_with_flags(&ce, NULL, 0);
#else
class_entry = zend_register_internal_class_ex(&ce, NULL);
#endif

return class_entry;
}
Loading

0 comments on commit 78a06df

Please sign in to comment.