From a5fcfc5b1aba835805c135d2eec652a1e2f9835e Mon Sep 17 00:00:00 2001 From: Takeshi Nakatani Date: Wed, 27 Nov 2024 10:52:12 +0900 Subject: [PATCH] Changed supported OS and PHP version and modified some codes --- .github/workflows/ci.yml | 22 +- .github/workflows/phpext_helper.sh | 126 +++---- .github/workflows/phpexttypevars.sh | 105 +++--- README.md | 12 +- buildutils/control.in.in | 36 +- buildutils/php-pecl-k2hdkc.spec.in | 2 +- buildutils/php_alpine_build.sh | 69 ++-- buildutils/rules.in | 18 - k2hdkcpx_arginfo.h | 1 + k2hdkcpx_arginfo_php7.h | 520 ---------------------------- k2hdkcpx_compat.h | 33 -- k2hdkcpx_func.c | 2 +- 12 files changed, 172 insertions(+), 774 deletions(-) delete mode 100644 k2hdkcpx_arginfo_php7.h delete mode 100644 k2hdkcpx_compat.h diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bbb258d..1496e05 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,23 +53,23 @@ jobs: # matrix: container: + - ubuntu:24.04 - ubuntu:22.04 - ubuntu:20.04 - debian:bookworm - debian:bullseye - - debian:buster - rockylinux:9 - rockylinux:8 - - centos:centos7 - - fedora:39 - - fedora:38 + - fedora:41 + - fedora:40 + - alpine:3.20 - alpine:3.19 - alpine:3.18 php: - - PHP80 - PHP81 - PHP82 + - PHP83 container: image: ${{ matrix.container }} @@ -86,19 +86,9 @@ jobs: NO_INTERACTION: 1 steps: - # [NOTE] - # actions/checkout@v3 uses nodejs v16 and will be deprecated. - # However, @v4 does not work on centos7 depending on the glibc version, - # so we will continue to use @v3. - # - - name: Checkout source code(other than centos7) - if: matrix.container != 'centos:centos7' + - name: Checkout source code uses: actions/checkout@v4 - - name: Checkout source code(only centos7) - if: matrix.container == 'centos:centos7' - uses: actions/checkout@v3 - # # Set environments from secrets # diff --git a/.github/workflows/phpext_helper.sh b/.github/workflows/phpext_helper.sh index b42774c..ecbfbf9 100755 --- a/.github/workflows/phpext_helper.sh +++ b/.github/workflows/phpext_helper.sh @@ -532,7 +532,7 @@ run_pre_create_package() run_create_package() { if ! RUN_AS_SUBPROCESS="true" /bin/sh -c "${SWITCH_PHP_COMMAND} ${CREATE_PACKAGE_TOOL} ${CREATE_PACKAGE_TOOL_OPT_AUTO} --buildnum ${CI_BUILD_NUMBER} ${CREATE_PACKAGE_TOOL_OPT}"; then - PRNERR "Failed to create debian type packages" + PRNERR "Failed to create ${CI_OSTYPE} packages" return 1 fi return 0 @@ -828,12 +828,42 @@ if [ -n "${OPT_DEVELOPER_FULLNAME}" ]; then CI_DEVELOPER_FULLNAME="${OPT_DEVELOPER_FULLNAME}" elif [ -n "${ENV_DEVELOPER_FULLNAME}" ]; then CI_DEVELOPER_FULLNAME="${ENV_DEVELOPER_FULLNAME}" +else + # [NOTE] + # If this variable is not set in a project that uses configure, + # an attempt will be made to load the value from configure.ac etc. + # + if [ -f "${SRCTOP}/configure.custom" ]; then + CI_DEVELOPER_FULLNAME=$(grep '^[[:space:]]*DEB_NAME[[:space:]]*=' "${SRCTOP}/configure.custom" | sed -e 's|^[[:space:]]*DEB_NAME[[:space:]]*=[[:space:]]*||g' -e 's|^[[:space:]]*||g' -e 's|[[:space:]]*$||g') + fi + if [ -z "${CI_DEVELOPER_FULLNAME}" ] && [ -f "${SRCTOP}/config.m4" ]; then + CI_DEVELOPER_FULLNAME=$(grep '^[[:space:]]*custom_dev_name[[:space:]]*=' "${SRCTOP}/config.m4" | grep -v 'DEB_NAME' | sed -e 's|^[[:space:]]*custom_dev_name[[:space:]]*=[[:space:]]*||g' -e 's|^[[:space:]]*||g' -e 's|[[:space:]]*$||g' -e 's|"||g') + fi + if [ -z "${CI_DEVELOPER_FULLNAME}" ]; then + PRNWARN "DEVELOPER_FULLNAME is not set in the options or environment variables. There is no choice but to set the default value." + CI_DEVELOPER_FULLNAME="ANTPICKAX_DEVELOPER" + fi fi if [ -n "${OPT_DEVELOPER_EMAIL}" ]; then CI_DEVELOPER_EMAIL="${OPT_DEVELOPER_EMAIL}" elif [ -n "${ENV_DEVELOPER_EMAIL}" ]; then CI_DEVELOPER_EMAIL="${ENV_DEVELOPER_EMAIL}" +else + # [NOTE] + # If this variable is not set in a project that uses configure, + # an attempt will be made to load the value from configure.ac etc. + # + if [ -f "${SRCTOP}/configure.custom" ]; then + CI_DEVELOPER_EMAIL=$(grep '^[[:space:]]*DEV_EMAIL[[:space:]]*=' "${SRCTOP}/configure.custom" | sed -e 's|^[[:space:]]*DEV_EMAIL[[:space:]]*=[[:space:]]*||g' -e 's|^[[:space:]]*||g' -e 's|[[:space:]]*$||g') + fi + if [ -z "${CI_DEVELOPER_EMAIL}" ] && [ -f "${SRCTOP}/config.m4" ]; then + CI_DEVELOPER_EMAIL=$(grep '^[[:space:]]*custom_dev_email[[:space:]]*=' "${SRCTOP}/config.m4" | grep -v 'DEV_EMAIL' | sed -e 's|^[[:space:]]*custom_dev_email[[:space:]]*=[[:space:]]*||g' -e 's|^[[:space:]]*||g' -e 's|[[:space:]]*$||g' -e 's|"||g') + fi + if [ -z "${CI_DEVELOPER_EMAIL}" ]; then + PRNWARN "DEVELOPER_EMAIL is not set in the options or environment variables. There is no choice but to set the default value." + CI_DEVELOPER_EMAIL="antpickax-support@mail.yahoo.co.jp" + fi fi if [ -n "${OPT_FORCE_PUBLISH}" ]; then @@ -901,13 +931,19 @@ elif [ -n "${ENV_PACKAGECLOUD_DOWNLOAD_REPO}" ]; then fi # -# Set environments for debian package +# Set environments for debian/alpine package # if [ -n "${CI_DEVELOPER_FULLNAME}" ]; then - export DEBEMAIL="${CI_DEVELOPER_FULLNAME}" + export DEBFULLNAME="${CI_DEVELOPER_FULLNAME}" +else + PRNERR "\"CI_DEVELOPER_FULLNAME\" value is not set." + exit 1 fi if [ -n "${CI_DEVELOPER_EMAIL}" ]; then - export DEBFULLNAME="${CI_DEVELOPER_EMAIL}" + export DEBEMAIL="${CI_DEVELOPER_EMAIL}" +else + PRNERR "\"CI_DEVELOPER_EMAIL\" value is not set." + exit 1 fi # [NOTE] for ubuntu/debian @@ -1013,12 +1049,6 @@ elif [ "${IS_OS_DEBIAN}" -eq 1 ]; then CREATE_PACKAGE_TOOL="${CREATE_PACKAGE_TOOL_DEBIAN}" CREATE_PACKAGE_TOOL_OPT="${CREATE_PACKAGE_TOOL_OPT_DEBIAN}" -elif [ "${IS_OS_CENTOS}" -eq 1 ]; then - BUILD_MAKE_EXT_OPT="${BUILD_MAKE_EXT_OPT_DEBIAN}" - MAKE_TEST_OPT="${MAKE_TEST_OPT_DEBIAN}" - CREATE_PACKAGE_TOOL="${CREATE_PACKAGE_TOOL_RPM}" - CREATE_PACKAGE_TOOL_OPT="${CREATE_PACKAGE_TOOL_OPT_RPM}" - elif [ "${IS_OS_FEDORA}" -eq 1 ]; then BUILD_MAKE_EXT_OPT="${BUILD_MAKE_EXT_OPT_RPM}" MAKE_TEST_OPT="${MAKE_TEST_OPT_RPM}" @@ -1160,7 +1190,6 @@ echo " SWITCH_PHP_COMMAND = ${SWITCH_PHP_COMMAND}" echo "" echo " IS_OS_UBUNTU = ${IS_OS_UBUNTU}" echo " IS_OS_DEBIAN = ${IS_OS_DEBIAN}" -echo " IS_OS_CENTOS = ${IS_OS_CENTOS}" echo " IS_OS_FEDORA = ${IS_OS_FEDORA}" echo " IS_OS_ROCKY = ${IS_OS_ROCKY}" echo " IS_OS_ALPINE = ${IS_OS_ALPINE}" @@ -1227,7 +1256,7 @@ if [ "${CI_USE_PACKAGECLOUD_REPO}" -eq 1 ]; then # # Setup packagecloud.io repository # - if [ "${IS_OS_CENTOS}" -eq 1 ] || [ "${IS_OS_FEDORA}" -eq 1 ] || [ "${IS_OS_ROCKY}" -eq 1 ]; then + if [ "${IS_OS_FEDORA}" -eq 1 ] || [ "${IS_OS_ROCKY}" -eq 1 ]; then PC_REPO_ADD_SH="script.rpm.sh" PC_REPO_ADD_SH_RUN="bash" elif [ "${IS_OS_UBUNTU}" -eq 1 ] || [ "${IS_OS_DEBIAN}" -eq 1 ]; then @@ -1247,7 +1276,7 @@ if [ "${CI_USE_PACKAGECLOUD_REPO}" -eq 1 ]; then exit 1 fi else - PRNWARN "OS is not debian/ubuntu nor centos/fedora/rocky nor alpine, then we do not know which download script use. Thus skip to setup packagecloud.io repository." + PRNWARN "OS is not debian/ubuntu nor fedora/rocky nor alpine, then we do not know which download script use. Thus skip to setup packagecloud.io repository." fi else PRNINFO "Not set packagecloud.io repository." @@ -1278,7 +1307,7 @@ PRNTITLE "Add PHP repositories" if [ -n "${INSTALL_PHP_REPO}" ]; then PRNINFO "PHP repositories" - if [ "${IS_OS_CENTOS}" -eq 1 ] || [ "${IS_OS_ROCKY}" -eq 1 ] || [ "${IS_OS_FEDORA}" -eq 1 ]; then + if [ "${IS_OS_ROCKY}" -eq 1 ] || [ "${IS_OS_FEDORA}" -eq 1 ]; then if ({ RUNCMD "${INSTALLER_BIN}" "${INSTALL_CMD}" "${INSTALL_CMD_ARG}" "${INSTALL_AUTO_ARG}" "${INSTALL_QUIET_ARG}" "${INSTALL_PHP_REPO}" || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then PRNERR "Failed to add PHP repository." exit 1 @@ -1414,28 +1443,7 @@ if [ "${CI_DO_PUBLISH}" -eq 1 ]; then GEM_BIN="gem" GEM_INSTALL_CMD="install" - if [ "${IS_OS_CENTOS}" -eq 1 ] && echo "${CI_OSTYPE}" | sed -e 's#:##g' | grep -q -i -e 'centos7' -e 'centos6'; then - # - # Case for CentOS - # - PRNWARN "OS is CentOS 7(6), so install ruby by special means(SCL)." - - if ({ RUNCMD "${INSTALLER_BIN}" "${INSTALL_CMD}" "${INSTALL_CMD_ARG}" "${INSTALL_AUTO_ARG}" "${INSTALL_QUIET_ARG}" centos-release-scl || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then - PRNERR "Failed to install SCL packages" - exit 1 - fi - if ({ RUNCMD "${INSTALLER_BIN}" "${INSTALL_CMD}" "${INSTALL_CMD_ARG}" "${INSTALL_AUTO_ARG}" "${INSTALL_QUIET_ARG}" rh-ruby27 rh-ruby27-ruby-devel rh-ruby27-rubygem-rake || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then - PRNERR "Failed to install ruby packages" - exit 1 - fi - . /opt/rh/rh-ruby27/enable - - if ({ RUNCMD "${GEM_BIN}" "${GEM_INSTALL_CMD}" package_cloud || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then - PRNERR "Failed to install packagecloud.io upload tools" - exit 1 - fi - - elif [ "${IS_OS_ALPINE}" -eq 1 ]; then + if [ "${IS_OS_ALPINE}" -eq 1 ]; then # # Case for Alpine # @@ -1565,7 +1573,7 @@ if [ "${CI_DO_PUBLISH}" -eq 1 ]; then else # - # Case for other than CentOS / Alpine / Debian 10 / Rocky Linux 8 + # Case for other than Alpine / Debian 10 / Rocky Linux 8 # if ({ RUNCMD "${GEM_BIN}" "${GEM_INSTALL_CMD}" rake package_cloud || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then PRNERR "Failed to install packagecloud.io upload tools" @@ -1582,29 +1590,10 @@ PRNSUCCESS "Install published tools for uploading packages to packagecloud.io" #-------------------------------------------------------------- PRNTITLE "Install cppcheck" -IS_SET_ANOTHER_REPOSITORIES=0 if [ "${RUN_CPPCHECK}" -eq 1 ]; then PRNINFO "Install cppcheck package." - if [ "${IS_OS_CENTOS}" -eq 1 ]; then - # - # CentOS - # - if ({ RUNCMD "${INSTALLER_BIN}" "${INSTALL_CMD}" "${INSTALL_CMD_ARG}" "${INSTALL_AUTO_ARG}" epel-release || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then - PRNERR "Failed to install epel repository" - exit 1 - fi - if ({ RUNCMD yum-config-manager --disable epel || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then - PRNERR "Failed to disable epel repository" - exit 1 - fi - if ({ RUNCMD "${INSTALLER_BIN}" --enablerepo=epel "${INSTALL_CMD}" "${INSTALL_CMD_ARG}" "${INSTALL_AUTO_ARG}" cppcheck || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then - PRNERR "Failed to install cppcheck from epel repository" - exit 1 - fi - IS_SET_ANOTHER_REPOSITORIES=1 - - elif [ "${IS_OS_FEDORA}" -eq 1 ]; then + if [ "${IS_OS_FEDORA}" -eq 1 ]; then # # Fedora # @@ -1647,7 +1636,6 @@ if [ "${RUN_CPPCHECK}" -eq 1 ]; then PRNERR "Failed to install cppcheck" exit 1 fi - IS_SET_ANOTHER_REPOSITORIES=1 elif [ "${IS_OS_UBUNTU}" -eq 1 ] || [ "${IS_OS_DEBIAN}" -eq 1 ]; then # @@ -1683,27 +1671,7 @@ PRNTITLE "Install shellcheck" if [ "${RUN_SHELLCHECK}" -eq 1 ]; then PRNINFO "Install shellcheck package." - if [ "${IS_OS_CENTOS}" -eq 1 ]; then - # - # CentOS - # - if [ "${IS_SET_ANOTHER_REPOSITORIES}" -eq 0 ]; then - if ({ RUNCMD "${INSTALLER_BIN}" "${INSTALL_CMD}" "${INSTALL_CMD_ARG}" "${INSTALL_AUTO_ARG}" epel-release || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then - PRNERR "Failed to install epel repository" - exit 1 - fi - if ({ RUNCMD yum-config-manager --disable epel || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then - PRNERR "Failed to disable epel repository" - exit 1 - fi - IS_SET_ANOTHER_REPOSITORIES=1 - fi - if ({ RUNCMD "${INSTALLER_BIN}" --enablerepo=epel "${INSTALL_CMD}" "${INSTALL_CMD_ARG}" "${INSTALL_AUTO_ARG}" ShellCheck || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's/^/ /g') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then - PRNERR "Failed to install ShellCheck from epel repository" - exit 1 - fi - - elif [ "${IS_OS_FEDORA}" -eq 1 ]; then + if [ "${IS_OS_FEDORA}" -eq 1 ]; then # # Fedora # diff --git a/.github/workflows/phpexttypevars.sh b/.github/workflows/phpexttypevars.sh index d3bf6b6..698fe23 100644 --- a/.github/workflows/phpexttypevars.sh +++ b/.github/workflows/phpexttypevars.sh @@ -63,7 +63,6 @@ # # IS_OS_UBUNTU : Set to 1 for Ubuntu, 0 otherwise # IS_OS_DEBIAN : Set to 1 for Debian, 0 otherwise -# IS_OS_CENTOS : Set to 1 for CentOS, 0 otherwise # IS_OS_FEDORA : Set to 1 for Fedora, 0 otherwise # IS_OS_ROCKY : Set to 1 for Rocky, 0 otherwise # IS_OS_ALPINE : Set to 1 for Alpine, 0 otherwise @@ -111,7 +110,6 @@ PHPVER_WITHPERIOD="" IS_OS_UBUNTU=0 IS_OS_DEBIAN=0 -IS_OS_CENTOS=0 IS_OS_FEDORA=0 IS_OS_ROCKY=0 IS_OS_ALPINE=0 @@ -132,18 +130,22 @@ if [ -z "${CI_PHPTYPE}" ]; then # Unknown PHP version : Nothing to do # : -elif [ "${CI_PHPTYPE}" = "PHP7.4" ] || [ "${CI_PHPTYPE}" = "PHP74" ] || [ "${CI_PHPTYPE}" = "PHP7" ] || [ "${CI_PHPTYPE}" = "7.4" ] || [ "${CI_PHPTYPE}" = "74" ] || [ "${CI_PHPTYPE}" = "7" ]; then - PHPVER_NOPERIOD="74" - PHPVER_WITHPERIOD="7.4" -elif [ "${CI_PHPTYPE}" = "PHP8.0" ] || [ "${CI_PHPTYPE}" = "PHP80" ] || [ "${CI_PHPTYPE}" = "8.0" ] || [ "${CI_PHPTYPE}" = "80" ]; then + +elif echo "${CI_PHPTYPE}" | grep -q -i -e "PHP8.0" -e "PHP80" -e "8.0" -e "80"; then PHPVER_NOPERIOD="80" PHPVER_WITHPERIOD="8.0" -elif [ "${CI_PHPTYPE}" = "PHP8.1" ] || [ "${CI_PHPTYPE}" = "PHP81" ] || [ "${CI_PHPTYPE}" = "8.1" ] || [ "${CI_PHPTYPE}" = "81" ]; then + +elif echo "${CI_PHPTYPE}" | grep -q -i -e "PHP8.1" -e "PHP81" -e "8.1" -e "81"; then PHPVER_NOPERIOD="81" PHPVER_WITHPERIOD="8.1" -elif [ "${CI_PHPTYPE}" = "PHP8.2" ] || [ "${CI_PHPTYPE}" = "PHP82" ] || [ "${CI_PHPTYPE}" = "8.2" ] || [ "${CI_PHPTYPE}" = "82" ]; then + +elif echo "${CI_PHPTYPE}" | grep -q -i -e "PHP8.2" -e "PHP82" -e "8.2" -e "82"; then PHPVER_NOPERIOD="82" PHPVER_WITHPERIOD="8.2" + +elif echo "${CI_PHPTYPE}" | grep -q -i -e "PHP8.3" -e "PHP83" -e "8.3" -e "83"; then + PHPVER_NOPERIOD="83" + PHPVER_WITHPERIOD="8.3" fi # @@ -154,8 +156,9 @@ if [ -z "${CI_OSTYPE}" ]; then # Unknown OS : Nothing to do # : -elif [ "${CI_OSTYPE}" = "ubuntu:22.04" ] || [ "${CI_OSTYPE}" = "ubuntu:jammy" ]; then - DIST_TAG="ubuntu/jammy" + +elif echo "${CI_OSTYPE}" | grep -q -i -e "ubuntu:24.04" -e "ubuntu:noble"; then + DIST_TAG="ubuntu/noble" PKG_EXT="deb" PKG_OUTPUT_DIR="packages" @@ -178,8 +181,8 @@ elif [ "${CI_OSTYPE}" = "ubuntu:22.04" ] || [ "${CI_OSTYPE}" = "ubuntu:jammy" ]; IS_OS_UBUNTU=1 -elif [ "${CI_OSTYPE}" = "ubuntu:20.04" ] || [ "${CI_OSTYPE}" = "ubuntu:focal" ]; then - DIST_TAG="ubuntu/focal" +elif echo "${CI_OSTYPE}" | grep -q -i -e "ubuntu:22.04" -e "ubuntu:jammy"; then + DIST_TAG="ubuntu/jammy" PKG_EXT="deb" PKG_OUTPUT_DIR="packages" @@ -202,8 +205,8 @@ elif [ "${CI_OSTYPE}" = "ubuntu:20.04" ] || [ "${CI_OSTYPE}" = "ubuntu:focal" ]; IS_OS_UBUNTU=1 -elif [ "${CI_OSTYPE}" = "debian:12" ] || [ "${CI_OSTYPE}" = "debian:bookworm" ]; then - DIST_TAG="debian/bookworm" +elif echo "${CI_OSTYPE}" | grep -q -i -e "ubuntu:20.04" -e "ubuntu:focal"; then + DIST_TAG="ubuntu/focal" PKG_EXT="deb" PKG_OUTPUT_DIR="packages" @@ -217,19 +220,17 @@ elif [ "${CI_OSTYPE}" = "debian:12" ] || [ "${CI_OSTYPE}" = "debian:bookworm" ]; INSTALL_PKG_LIST="git lintian debhelper pkg-config ruby-dev rubygems rubygems-integration procps shtool k2hdkc-dev" INSTALL_PHP_PRE_ADD_REPO="ca-certificates apt-transport-https software-properties-common" - INSTALL_PHP_REPO="packages.sury.org/php" - INSTALL_PHP_REPO_GPG_URL="https://packages.sury.org/php/apt.gpg" - INSTALL_PHP_REPO_GPG_FILEPATH="/usr/share/keyrings/deb.sury.org-php.gpg" + INSTALL_PHP_REPO="ppa:ondrej/php" INSTALL_PHP_PKG_LIST="dh-php php${PHPVER_WITHPERIOD} php${PHPVER_WITHPERIOD}-dev libapache2-mod-php${PHPVER_WITHPERIOD}" INSTALL_PHP_OPT="" INSTALL_PHP_POST_CONFIG="update-alternatives --set php-config /usr/bin/php-config${PHPVER_WITHPERIOD}" INSTALL_PHP_POST_BIN="update-alternatives --set php /usr/bin/php${PHPVER_WITHPERIOD}" SWITCH_PHP_COMMAND="" - IS_OS_DEBIAN=1 + IS_OS_UBUNTU=1 -elif [ "${CI_OSTYPE}" = "debian:11" ] || [ "${CI_OSTYPE}" = "debian:bullseye" ]; then - DIST_TAG="debian/bullseye" +elif echo "${CI_OSTYPE}" | grep -q -i -e "debian:12" -e "debian:bookworm"; then + DIST_TAG="debian/bookworm" PKG_EXT="deb" PKG_OUTPUT_DIR="packages" @@ -254,8 +255,8 @@ elif [ "${CI_OSTYPE}" = "debian:11" ] || [ "${CI_OSTYPE}" = "debian:bullseye" ]; IS_OS_DEBIAN=1 -elif [ "${CI_OSTYPE}" = "debian:10" ] || [ "${CI_OSTYPE}" = "debian:buster" ]; then - DIST_TAG="debian/buster" +elif echo "${CI_OSTYPE}" | grep -q -i -e "debian:11" -e "debian:bullseye"; then + DIST_TAG="debian/bullseye" PKG_EXT="deb" PKG_OUTPUT_DIR="packages" @@ -280,7 +281,7 @@ elif [ "${CI_OSTYPE}" = "debian:10" ] || [ "${CI_OSTYPE}" = "debian:buster" ]; t IS_OS_DEBIAN=1 -elif [ "${CI_OSTYPE}" = "rockylinux:9.0" ] || [ "${CI_OSTYPE}" = "rockylinux:9" ]; then +elif echo "${CI_OSTYPE}" | grep -q -i "rockylinux:9"; then DIST_TAG="el/9" PKG_EXT="rpm" PKG_OUTPUT_DIR="packages" @@ -314,7 +315,7 @@ elif [ "${CI_OSTYPE}" = "rockylinux:9.0" ] || [ "${CI_OSTYPE}" = "rockylinux:9" echo "[ERROR] Failed to install \"dnf-command(config-manager)\". The script doesn't break here, but fails to install the package." fi -elif [ "${CI_OSTYPE}" = "rockylinux:8.6" ] || [ "${CI_OSTYPE}" = "rockylinux:8" ]; then +elif echo "${CI_OSTYPE}" | grep -q -i "rockylinux:8"; then DIST_TAG="el/8" PKG_EXT="rpm" PKG_OUTPUT_DIR="packages" @@ -347,32 +348,32 @@ elif [ "${CI_OSTYPE}" = "rockylinux:8.6" ] || [ "${CI_OSTYPE}" = "rockylinux:8" echo "[ERROR] Failed to install \"dnf-command(config-manager)\". The script doesn't break here, but fails to install the package." fi -elif [ "${CI_OSTYPE}" = "centos:7" ] || [ "${CI_OSTYPE}" = "centos:centos7" ]; then - DIST_TAG="el/7" +elif echo "${CI_OSTYPE}" | grep -q -i "fedora:41"; then + DIST_TAG="fedora/41" PKG_EXT="rpm" PKG_OUTPUT_DIR="packages" - INSTALLER_BIN="yum" + INSTALLER_BIN="dnf" UPDATE_CMD="update" UPDATE_CMD_ARG="" INSTALL_CMD="install" INSTALL_CMD_ARG="" INSTALL_AUTO_ARG="-y" INSTALL_QUIET_ARG="-q" - INSTALL_PKG_LIST="git make diffutils pkgconfig patch yum-utils rpmdevtools redhat-rpm-config rpm-build rpm-devel rpmlint scl-utils-build rubygems procps python k2hdkc-devel" + INSTALL_PKG_LIST="git make diffutils pkgconfig patch yum-utils rpmdevtools redhat-rpm-config rpm-build rpm-devel rpmlint scl-utils-build ruby-devel rubygems procps python3 k2hdkc-devel" - INSTALL_PHP_PRE_ADD_REPO="centos-release-scl-rh centos-release-scl" - INSTALL_PHP_REPO="https://rpms.remirepo.net/enterprise/remi-release-7.rpm" + INSTALL_PHP_PRE_ADD_REPO="" + INSTALL_PHP_REPO="https://rpms.remirepo.net/fedora/remi-release-41.rpm" INSTALL_PHP_PKG_LIST="php${PHPVER_NOPERIOD}-php-devel php${PHPVER_NOPERIOD}-scldevel php${PHPVER_NOPERIOD}-build" - INSTALL_PHP_OPT="--enablerepo=remi-php${PHPVER_NOPERIOD}" + INSTALL_PHP_OPT="" INSTALL_PHP_POST_CONFIG="" INSTALL_PHP_POST_BIN="" SWITCH_PHP_COMMAND="scl enable php${PHPVER_NOPERIOD} --" - IS_OS_CENTOS=1 + IS_OS_FEDORA=1 -elif [ "${CI_OSTYPE}" = "fedora:39" ]; then - DIST_TAG="fedora/39" +elif echo "${CI_OSTYPE}" | grep -q -i "fedora:40"; then + DIST_TAG="fedora/40" PKG_EXT="rpm" PKG_OUTPUT_DIR="packages" @@ -386,7 +387,7 @@ elif [ "${CI_OSTYPE}" = "fedora:39" ]; then INSTALL_PKG_LIST="git make diffutils pkgconfig patch yum-utils rpmdevtools redhat-rpm-config rpm-build rpm-devel rpmlint scl-utils-build ruby-devel rubygems procps python3 k2hdkc-devel" INSTALL_PHP_PRE_ADD_REPO="" - INSTALL_PHP_REPO="https://rpms.remirepo.net/fedora/remi-release-39.rpm" + INSTALL_PHP_REPO="https://rpms.remirepo.net/fedora/remi-release-40.rpm" INSTALL_PHP_PKG_LIST="php${PHPVER_NOPERIOD}-php-devel php${PHPVER_NOPERIOD}-scldevel php${PHPVER_NOPERIOD}-build" INSTALL_PHP_OPT="" INSTALL_PHP_POST_CONFIG="" @@ -395,31 +396,35 @@ elif [ "${CI_OSTYPE}" = "fedora:39" ]; then IS_OS_FEDORA=1 -elif [ "${CI_OSTYPE}" = "fedora:38" ]; then - DIST_TAG="fedora/38" - PKG_EXT="rpm" +elif echo "${CI_OSTYPE}" | grep -q -i "alpine:3.20"; then + DIST_TAG="alpine/v3.20" + PKG_EXT="apk" PKG_OUTPUT_DIR="packages" - INSTALLER_BIN="dnf" + INSTALLER_BIN="apk" UPDATE_CMD="update" - UPDATE_CMD_ARG="" - INSTALL_CMD="install" - INSTALL_CMD_ARG="" - INSTALL_AUTO_ARG="-y" + UPDATE_CMD_ARG="--no-progress" + INSTALL_CMD="add" + INSTALL_CMD_ARG="--no-progress --no-cache" + INSTALL_AUTO_ARG="" INSTALL_QUIET_ARG="-q" - INSTALL_PKG_LIST="git make diffutils pkgconfig patch yum-utils rpmdevtools redhat-rpm-config rpm-build rpm-devel rpmlint scl-utils-build ruby-devel rubygems procps python3 k2hdkc-devel" + INSTALL_PKG_LIST="bash sudo alpine-sdk util-linux-misc musl-locales ruby-dev procps k2hdkc-dev" INSTALL_PHP_PRE_ADD_REPO="" - INSTALL_PHP_REPO="https://rpms.remirepo.net/fedora/remi-release-38.rpm" - INSTALL_PHP_PKG_LIST="php${PHPVER_NOPERIOD}-php-devel php${PHPVER_NOPERIOD}-scldevel php${PHPVER_NOPERIOD}-build" + INSTALL_PHP_REPO="" + INSTALL_PHP_PKG_LIST="php${PHPVER_NOPERIOD} php${PHPVER_NOPERIOD}-dev" INSTALL_PHP_OPT="" INSTALL_PHP_POST_CONFIG="" INSTALL_PHP_POST_BIN="" - SWITCH_PHP_COMMAND="scl enable php${PHPVER_NOPERIOD} --" + SWITCH_PHP_COMMAND="" - IS_OS_FEDORA=1 + IS_OS_ALPINE=1 + + if [ "${PHPVER_NOPERIOD}" != "83" ]; then + NOT_PROVIDED_PHPVER=1 + fi -elif [ "${CI_OSTYPE}" = "alpine:3.19" ]; then +elif echo "${CI_OSTYPE}" | grep -q -i "alpine:3.19"; then DIST_TAG="alpine/v3.19" PKG_EXT="apk" PKG_OUTPUT_DIR="packages" @@ -447,7 +452,7 @@ elif [ "${CI_OSTYPE}" = "alpine:3.19" ]; then NOT_PROVIDED_PHPVER=1 fi -elif [ "${CI_OSTYPE}" = "alpine:3.18" ]; then +elif echo "${CI_OSTYPE}" | grep -q -i "alpine:3.18"; then DIST_TAG="alpine/v3.18" PKG_EXT="apk" PKG_OUTPUT_DIR="packages" diff --git a/README.md b/README.md index 361bf79..3395f8f 100644 --- a/README.md +++ b/README.md @@ -33,9 +33,9 @@ $ sudo apt-get update -y $ sudo apt-get install curl -y $ curl -s https://packagecloud.io/install/repositories/antpickax/stable/script.deb.sh | sudo bash -$ sudo apt-get install -y php8.2 libapache2-mod-php8.2 -$ sudo update-alternatives --set php-config /usr/bin/php-config8.2 -$ sudo update-alternatives --set php /usr/bin/php8.2 +$ sudo apt-get install -y php8.3 libapache2-mod-php8.3 +$ sudo update-alternatives --set php-config /usr/bin/php-config8.3 +$ sudo update-alternatives --set php /usr/bin/php8.3 $ sudo apt-get install -y k2hdkc php-pecl-k2hdkc ``` - Fedora derived RPM based Linux(Fedora, CentOS, CentOS Stream, RHEL, etc.) users can install it by following the steps below: @@ -44,10 +44,10 @@ $ sudo dnf update -y $ curl -s https://packagecloud.io/install/repositories/antpickax/stable/script.rpm.sh | sudo bash -$ sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -$ sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm +$ sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm +$ sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-9.rpm $ sudo dnf module reset php -$ sudo dnf module install php:remi-8.2 +$ sudo dnf module install php:remi-8.3 $ sudo dnf install -y php-pecl-k2hdkc ``` diff --git a/buildutils/control.in.in b/buildutils/control.in.in index 992d48c..1300cab 100644 --- a/buildutils/control.in.in +++ b/buildutils/control.in.in @@ -3,13 +3,15 @@ Section: php Priority: optional Maintainer: @DEV_NAME@ <@DEV_EMAIL@> Uploaders: @DEV_NAME@ <@DEV_EMAIL@> -Build-Depends: debhelper (>= 10~), debhelper-compat (= 11), dh-php (>= 4~), k2hdkc-dev, php@K2HDKCPX_PHP_MAJOR_VERSION@.@K2HDKCPX_PHP_MINOR_VERSION@-dev +Build-Depends: debhelper (>= 10~), debhelper-compat (= 11), dh-php (>= 4~), + php@K2HDKCPX_PHP_VERSION@-dev, k2hdkc-dev Standards-Version: 4.5.1 Homepage: @HOME_PAGE@ Vcs-Git: https://@GIT_DOMAIN@/@GIT_ORG@/@GIT_REPO@.git Vcs-Browser: https://@GIT_DOMAIN@/@GIT_ORG@/@GIT_REPO@ +X-PHP-Versions: @K2HDKCPX_PHP_VERSION@ -Package: php7.4-@PHP_PECL_BASE_NAME@ +Package: php@K2HDKCPX_PHP_VERSION@-@PHP_PECL_BASE_NAME@ Architecture: any Pre-Depends: php-common (>= 2:69~) Depends: ucf, ${misc:Depends}, ${pecl:Depends}, ${shlibs:Depends}, ${php:Depends} @@ -18,34 +20,8 @@ Breaks: ${pecl:Breaks} Replaces: ${pecl:Replaces} Suggests: ${pecl:Suggests} Recommends: ${pecl:Recommends} -Description: k2hdkc extension for PHP7.4 - This extension adds API for k2hdkc for PHP7.4. - This package is a metapackage of @K2HDKCPX_EXT_PKGNAME@. - -Package: php8.0-@PHP_PECL_BASE_NAME@ -Architecture: any -Pre-Depends: php-common (>= 2:69~) -Depends: ucf, ${misc:Depends}, ${pecl:Depends}, ${shlibs:Depends}, ${php:Depends} -Provides: ${pecl:Provides}, ${php:Provides} -Breaks: ${pecl:Breaks} -Replaces: ${pecl:Replaces} -Suggests: ${pecl:Suggests} -Recommends: ${pecl:Recommends} -Description: k2hdkc extension for PHP8.0 - This extension adds API for k2hdkc for PHP8.0. - This package is a metapackage of @K2HDKCPX_EXT_PKGNAME@. - -Package: php8.1-@PHP_PECL_BASE_NAME@ -Architecture: any -Pre-Depends: php-common (>= 2:69~) -Depends: ucf, ${misc:Depends}, ${pecl:Depends}, ${shlibs:Depends}, ${php:Depends} -Provides: ${pecl:Provides}, ${php:Provides} -Breaks: ${pecl:Breaks} -Replaces: ${pecl:Replaces} -Suggests: ${pecl:Suggests} -Recommends: ${pecl:Recommends} -Description: k2hdkc extension for PHP8.1 - This extension adds API for k2hdkc for PHP8.1. +Description: k2hdkc extension for PHP@K2HDKCPX_PHP_VERSION@ + This extension adds API for k2hdkc for PHP@K2HDKCPX_PHP_VERSION@. This package is a metapackage of @K2HDKCPX_EXT_PKGNAME@. Package: @K2HDKCPX_EXT_PKGNAME@ diff --git a/buildutils/php-pecl-k2hdkc.spec.in b/buildutils/php-pecl-k2hdkc.spec.in index 8c877e0..ba3fddb 100644 --- a/buildutils/php-pecl-k2hdkc.spec.in +++ b/buildutils/php-pecl-k2hdkc.spec.in @@ -57,7 +57,7 @@ URL: https://@GIT_DOMAIN@/@GIT_ORG@/@GIT_REPO@/ Source0: https://@GIT_DOMAIN@/@GIT_ORG@/@GIT_REPO@/archive/@K2HDKCPX_EXT_PKGNAME@-%{version}.tar.gz BuildRequires: %{?dtsprefix}gcc -BuildRequires: %{?scl_prefix}php-devel >= 7.4 +BuildRequires: %{?scl_prefix}php-devel >= 8.1 BuildRequires: k2hdkc-devel >= %{buildver} Requires: k2hdkc%{?_isa} >= %{buildver} diff --git a/buildutils/php_alpine_build.sh b/buildutils/php_alpine_build.sh index 19d9ad7..da8115a 100755 --- a/buildutils/php_alpine_build.sh +++ b/buildutils/php_alpine_build.sh @@ -65,6 +65,7 @@ EXTRA_COPY_FILES_CONF="${SCRIPTDIR}/${PRGNAME_NOEXT}_copy.conf" APKBUILD_TEMPLATE_FILE="${SRCTOP}/buildutils/APKBUILD.templ" APKBUILD_FILE="${APK_TOPDIR}/APKBUILD" APKBUILD_CONFIG_DIR="${HOME}/.abuild" +APK_KEYS_DIR="/etc/apk/keys" # # Message variables @@ -314,17 +315,28 @@ fi #-------------------------------------------------------------- # Check running as root user and Set APKBUILD option #-------------------------------------------------------------- -# [NOTE] -# The abuild tool drains errors when run as root. -# To avoid this, the "-F" option is required. -# PRNINFO "Check running as root user and Set APKBUILD option" +# +# Check running as root user +# RUN_USER_ID=$(id -u) -ABUILD_OPT="" +if [ -n "${RUN_USER_ID}" ] && [ "${RUN_USER_ID}" -eq 0 ]; then + SUDO_CMD="" +else + SUDO_CMD="sudo" +fi + +# [NOTE] +# The abuild tool drains errors when run as root. +# To avoid this, the "-F" option is required. +# If you need verbose message, you can add "-v" option here. +# if [ -n "${RUN_USER_ID}" ] && [ "${RUN_USER_ID}" -eq 0 ]; then ABUILD_OPT="-F" +else + ABUILD_OPT="" fi #-------------------------------------------------------------- @@ -338,12 +350,7 @@ PACKAGE_VERSION=$(head -n 1 "${SRCTOP}"/ChangeLog | sed -e 's/[(]//g' -e 's/[)]/ PACKAGE_PHPMAJORVERSION=$(php -r 'echo PHP_MAJOR_VERSION;') PACKAGE_PHPMINORVERSION=$(php -r 'echo PHP_MINOR_VERSION;') -if [ "${PACKAGE_PHPMAJORVERSION}" = "7" ]; then - # - # 7.4 -> 7 - # - PACKAGE_PHPVERSION="${PACKAGE_PHPMAJORVERSION}" -elif [ "${PACKAGE_PHPMAJORVERSION}" = "8" ] && [ "${PACKAGE_PHPMINORVERSION}" = "0" ]; then +if [ "${PACKAGE_PHPMAJORVERSION}" = "8" ] && [ "${PACKAGE_PHPMINORVERSION}" = "0" ]; then # # 8.0 -> 8 # @@ -446,6 +453,28 @@ PRNSUCCESS "Created ${APK_TOPDIR}" #--------------------------------------------------------------- PRNTITLE "Create RSA key for signing" +# +# Determining the RSA key location directory +# +# [NOTE] +# This directory path depends on the apk-tools version. +# It is different for 2.14.4 and later and previous versions. +# +APKTOOLS_ALL_VER=$(apk list apk-tools | awk '{print $1}' | tail -1) +APKTOOLS_MAJOR_VER=$(echo "${APKTOOLS_ALL_VER}" | sed -e 's#^[[:space:]]*apk-tools-##g' -e 's#-# #g' -e 's#\.# #g' | awk '{print $1}') +APKTOOLS_MINOR_VER=$(echo "${APKTOOLS_ALL_VER}" | sed -e 's#^[[:space:]]*apk-tools-##g' -e 's#-# #g' -e 's#\.# #g' | awk '{print $2}') +APKTOOLS_PATCH_VER=$(echo "${APKTOOLS_ALL_VER}" | sed -e 's#^[[:space:]]*apk-tools-##g' -e 's#-# #g' -e 's#\.# #g' | awk '{print $3}') +if [ -z "${APKTOOLS_MAJOR_VER}" ] || [ -z "${APKTOOLS_MINOR_VER}" ] || [ -z "${APKTOOLS_PATCH_VER}" ]; then + echo "[ERROR] Could not get aok-tools package version." 1>&2 + exit 1 +fi +APKTOOLS_MIX_VER=$((APKTOOLS_MAJOR_VER * 1000 * 1000 + APKTOOLS_MINOR_VER * 1000 + APKTOOLS_PATCH_VER)) +if [ "${APKTOOLS_MIX_VER}" -lt 2014004 ]; then + RSA_KEYS_DIR="${APK_TOPDIR}" +else + RSA_KEYS_DIR="${APK_KEYS_DIR}" +fi + # # Check "${HOME}/.abuild" directory # @@ -477,12 +506,12 @@ if ! find "${APKBUILD_CONFIG_DIR}" -name "${DEBEMAIL}"-\*\.rsa\.pub | grep -q "$ PRNERR "Not found ${APKBUILD_CONFIG_DIR}/${DEBEMAIL}-.rsa.pub files." exit 1 fi -if ! cp -p "${APKBUILD_CONFIG_DIR}"/"${DEBEMAIL}"-*.rsa "${APK_TOPDIR}"; then - PRNERR "Failed to copy RSA private key(${APKBUILD_CONFIG_DIR}/${DEBEMAIL}-.rsa) to ${APK_TOPDIR} directory." +if ! /bin/sh -c "${SUDO_CMD} cp -p ${APKBUILD_CONFIG_DIR}/${DEBEMAIL}-*.rsa ${RSA_KEYS_DIR} >/dev/null 2>&1"; then + PRNERR "Failed to copy RSA private key(${APKBUILD_CONFIG_DIR}/${DEBEMAIL}-.rsa) to ${RSA_KEYS_DIR} directory." exit 1 fi -if ! cp -p "${APKBUILD_CONFIG_DIR}"/"${DEBEMAIL}"-*.rsa.pub "${APK_TOPDIR}"; then - PRNERR "Failed to copy RSA public key(${APKBUILD_CONFIG_DIR}/${DEBEMAIL}-.rsa.pub) to ${APK_TOPDIR} directory." +if ! /bin/sh -c "${SUDO_CMD} cp -p ${APKBUILD_CONFIG_DIR}/${DEBEMAIL}-*.rsa.pub ${RSA_KEYS_DIR} >/dev/null 2>&1"; then + PRNERR "Failed to copy RSA public key(${APKBUILD_CONFIG_DIR}/${DEBEMAIL}-.rsa.pub) to ${RSA_KEYS_DIR} directory." exit 1 fi @@ -498,15 +527,15 @@ rm -rf "${APKBUILD_CONFIG_DIR}" # # Set file name/key contents to variables # -APK_PACKAGE_PRIV_KEYNAME="$(find "${APK_TOPDIR}" -name "${DEBEMAIL}"-\*\.rsa 2>/dev/null | head -1 | sed -e "s#${APK_TOPDIR}/##g" | tr -d '\n')" -APK_PACKAGE_PUB_KEYNAME="$(find "${APK_TOPDIR}" -name "${DEBEMAIL}"-\*\.rsa\.pub 2>/dev/null | head -1 | sed -e "s#${APK_TOPDIR}/##g" | tr -d '\n')" +APK_PACKAGE_PRIV_KEYNAME="$(find "${RSA_KEYS_DIR}" -name "${DEBEMAIL}"-\*\.rsa 2>/dev/null | head -1 | sed -e "s#${RSA_KEYS_DIR}/##g" | tr -d '\n')" +APK_PACKAGE_PUB_KEYNAME="$(find "${RSA_KEYS_DIR}" -name "${DEBEMAIL}"-\*\.rsa\.pub 2>/dev/null | head -1 | sed -e "s#${RSA_KEYS_DIR}/##g" | tr -d '\n')" # # Information # echo "" -echo " RSA private key : ${APK_TOPDIR}/${APK_PACKAGE_PRIV_KEYNAME}" -echo " RSA public key : ${APK_TOPDIR}/${APK_PACKAGE_PUB_KEYNAME}" +echo " RSA private key : ${RSA_KEYS_DIR}/${APK_PACKAGE_PRIV_KEYNAME}" +echo " RSA public key : ${RSA_KEYS_DIR}/${APK_PACKAGE_PUB_KEYNAME}" echo "" PRNSUCCESS "Created RSA keys" @@ -665,7 +694,7 @@ PRNTITLE "Build APK packages." # # build APK packages # -if ({ /bin/sh -c "PACKAGER_PRIVKEY=${APK_TOPDIR}/${APK_PACKAGE_PRIV_KEYNAME} abuild ${ABUILD_OPT} -r -P $(pwd)" || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's#^# #') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then +if ({ /bin/sh -c "PACKAGER_PRIVKEY=${RSA_KEYS_DIR}/${APK_PACKAGE_PRIV_KEYNAME} abuild ${ABUILD_OPT} -r -P $(pwd)" || echo > "${PIPEFAILURE_FILE}"; } | sed -e 's#^# #') && rm "${PIPEFAILURE_FILE}" >/dev/null 2>&1; then PRNERR "Failed to create APK packages." exit 1 fi diff --git a/buildutils/rules.in b/buildutils/rules.in index 1aaca52..3952cf8 100644 --- a/buildutils/rules.in +++ b/buildutils/rules.in @@ -38,24 +38,6 @@ override_dh_testdir: $(DIR_TARGETS) build-%: mkdir -p build-$(*) -# [NOTE] -# The "control" file will be created without the following call, -# but it will output "php-pecl-" instead of "php<8.1>-pecl-" -# and the build will fail. -# To avoid this, make the following call. -# -debian/control: debian/control.in - /usr/share/dh-php/gen-control - -# [NOTE] 2023/9 -# Because updated pkg-pecl.mk, the "-a" option is added when calling gen-control. -# If this "-a" option is given, an error will occur, so do not add the "-a" option -# as before the update. -# -override_dh_clean: - dh_clean - /usr/share/dh-php/gen-control - # # Local variables: # tab-width: 4 diff --git a/k2hdkcpx_arginfo.h b/k2hdkcpx_arginfo.h index 67a1192..692a8e8 100644 --- a/k2hdkcpx_arginfo.h +++ b/k2hdkcpx_arginfo.h @@ -20,6 +20,7 @@ /* This is a generated file, edit the .stub.php file instead. * Stub hash: 0a22cec1d02ec5be6ad60fc69b129d39cca236fa */ +// cppcheck-suppress unknownMacro ZEND_BEGIN_ARG_INFO_EX(arginfo_k2hdkcpx_open, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, config_file, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, port, IS_LONG, 0, "8031") diff --git a/k2hdkcpx_arginfo_php7.h b/k2hdkcpx_arginfo_php7.h deleted file mode 100644 index 3f9268b..0000000 --- a/k2hdkcpx_arginfo_php7.h +++ /dev/null @@ -1,520 +0,0 @@ -/* -* -* K2HDKC PHP Extension library -* -* Copyright 2023 Yahoo Japan Corporation. -* -* K2HDKC is k2hash based distributed KVS cluster. -* K2HDKC uses K2HASH, CHMPX, FULLOCK libraries. K2HDKC supports -* distributed KVS cluster server program and client libraries. -* -* For the full copyright and license information, please view -* the license file that was distributed with this source code. -* -* AUTHOR: Hirotaka Wakabayashi -* CREATE: Fri, Mar 31 2023 -* REVISION: -* -*/ - -/* This is a generated file, edit the .stub.php file instead. - * Stub hash: bb431b584b920bdd429ea0980c7d1a1d39e0ba09 */ - -ZEND_BEGIN_ARG_INFO_EX(arginfo_k2hdkcpx_open, -2, 0, 1) - ZEND_ARG_TYPE_INFO(0, configFile, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, port, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, cuk, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, rejoin, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, rejoinForever, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, clearBackup, _IS_BOOL, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_k2hdkcpx_set_value, -1, 3, _IS_BOOL, 0) - ZEND_ARG_INFO(0, handle_res) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, val, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, clearSubkeys, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, subkeys, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - // cppcheck-suppress unknownMacro - ZEND_ARG_TYPE_INFO(0, expirationDuration, IS_LONG, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_k2hdkcpx_get_value, 0, 2, IS_STRING, 1) - ZEND_ARG_INFO(0, handle_res) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_k2hdkcpx_add_subkey, 0, 4, _IS_BOOL, 0) - ZEND_ARG_INFO(0, handle_res) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, subkey, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, subval, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, check_attr, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, expiration_duration, IS_LONG, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_k2hdkcpx_cas_get, 0, 2, IS_LONG, 0) - ZEND_ARG_INFO(0, handle_res) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_k2hdkcpx_cas_decrement, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, handle_res) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, expiration_duration, IS_LONG, 0) - ZEND_END_ARG_INFO(); - -#define arginfo_k2hdkcpx_cas_increment arginfo_k2hdkcpx_cas_decrement - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_k2hdkcpx_cas_init, 0, 3, _IS_BOOL, 0) - ZEND_ARG_INFO(0, handle_res) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, val, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, expiration_duration, IS_LONG, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_k2hdkcpx_cas_set, 0, 4, _IS_BOOL, 0) - ZEND_ARG_INFO(0, handle_res) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, old_val, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, new_val, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, expiration_duration, IS_LONG, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_k2hdkcpx_clear_subkeys, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, handle_res) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_k2hdkcpx_close, 0, 1, _IS_BOOL, 0) - ZEND_ARG_INFO(0, handle_res) - ZEND_ARG_TYPE_INFO(0, is_clean_bup, _IS_BOOL, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_k2hdkcpx_get_attributes, 0, 2, IS_ARRAY, 1) - ZEND_ARG_INFO(0, handle_res) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_END_ARG_INFO(); - -#define arginfo_k2hdkcpx_get_subkeys arginfo_k2hdkcpx_get_attributes - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_k2hdkcpx_queue_get, 0, 2, IS_STRING, 1) - ZEND_ARG_INFO(0, handle_res) - ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, is_fifo, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_k2hdkcpx_queue_put, 0, 3, _IS_BOOL, 0) - ZEND_ARG_INFO(0, handle_res) - ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, val, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, is_fifo, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, is_check_attr, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, expiration_duration, IS_LONG, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_k2hdkcpx_key_queue_get, 0, 2, IS_ARRAY, 1) - ZEND_ARG_INFO(0, handle_res) - ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, is_fifo, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_k2hdkcpx_key_queue_put, 0, 4, _IS_BOOL, 0) - ZEND_ARG_INFO(0, handle_res) - ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, val, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, is_fifo, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, is_check_attr, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, expiration_duration, IS_LONG, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_k2hdkcpx_remove, 0, 2, _IS_BOOL, 0) - ZEND_ARG_INFO(0, handle_res) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_k2hdkcpx_remove_subkeys, 0, 3, _IS_BOOL, 0) - ZEND_ARG_INFO(0, handle_res) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, subkeys, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO(0, nested, _IS_BOOL, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_k2hdkcpx_rename, 0, 3, _IS_BOOL, 0) - ZEND_ARG_INFO(0, handle_res) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, new_key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, parent_key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, is_check_attr, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, expiration_duration, IS_LONG, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_k2hdkcpx_set_subkeys, 0, 3, _IS_BOOL, 0) - ZEND_ARG_INFO(0, handle_res) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, subkeys, IS_ARRAY, 0) - ZEND_END_ARG_INFO(); - -// cppcheck-suppress unknownMacro -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_k2hdkcpx_bump_debug_level, 0, 0, IS_VOID, 0) - ZEND_END_ARG_INFO(); - -#define arginfo_k2hdkcpx_set_debug_level_silent arginfo_k2hdkcpx_bump_debug_level - -#define arginfo_k2hdkcpx_set_debug_level_error arginfo_k2hdkcpx_bump_debug_level - -#define arginfo_k2hdkcpx_set_debug_level_warning arginfo_k2hdkcpx_bump_debug_level - -#define arginfo_k2hdkcpx_set_debug_level_message arginfo_k2hdkcpx_bump_debug_level - -#define arginfo_k2hdkcpx_set_debug_level_dump arginfo_k2hdkcpx_bump_debug_level - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_k2hdkcpx_set_debug_file, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, filepath, IS_STRING, 0) - ZEND_END_ARG_INFO(); - -#define arginfo_k2hdkcpx_unset_debug_file arginfo_k2hdkcpx_bump_debug_level - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_k2hdkcpx_load_debug_env, 0, 0, _IS_BOOL, 0) - ZEND_END_ARG_INFO(); - -#define arginfo_k2hdkcpx_is_enable_comlog arginfo_k2hdkcpx_load_debug_env - -#define arginfo_k2hdkcpx_enable_comlog arginfo_k2hdkcpx_load_debug_env - -#define arginfo_k2hdkcpx_disable_comlog arginfo_k2hdkcpx_load_debug_env - -#define arginfo_k2hdkcpx_toggle_comlog arginfo_k2hdkcpx_load_debug_env - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_K2hdkc___construct, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, config_file, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, port, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, cuk, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, rejoin, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, rejoin_forever, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, clear_backup, _IS_BOOL, 0) -ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_K2hdkc___destruct, 0, 0, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_K2hdkc_setValue, 0, 2, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, val, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, clear_subkeys, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, subkeys, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, expiration_duration, IS_LONG, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_K2hdkc_getValue, 0, 1, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_K2hdkc_addSubkey, 0, 3, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, subkey, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, subval, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, check_attr, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, expiration_duration, IS_LONG, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_K2hdkc_casGet, 0, 1, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_K2hdkc_casDecrement, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, expiration_duration, IS_LONG, 0) - ZEND_END_ARG_INFO(); - -#define arginfo_class_K2hdkc_casIncrement arginfo_class_K2hdkc_casDecrement - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_K2hdkc_casInit, 0, 2, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, val, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, expiration_duration, IS_LONG, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_K2hdkc_casSet, 0, 3, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, old_val, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, new_val, IS_LONG, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, expiration_duration, IS_LONG, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_K2hdkc_clearSubkeys, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_END_ARG_INFO(); - -#define arginfo_class_K2hdkc_close arginfo_k2hdkcpx_load_debug_env - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_K2hdkc_getAttrs, 0, 1, IS_ARRAY, 1) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_END_ARG_INFO(); - -#define arginfo_class_K2hdkc_getSubkeys arginfo_class_K2hdkc_getAttrs - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_K2hdkc_queueGet, 0, 1, IS_STRING, 1) - ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, is_fifo, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_K2hdkc_queuePut, 0, 2, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, val, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, is_fifo, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, is_check_attr, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, expiration_duration, IS_LONG, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_K2hdkc_keyQueueGet, 0, 1, IS_ARRAY, 1) - ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, is_fifo, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_K2hdkc_keyQueuePut, 0, 3, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, val, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, is_fifo, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, is_check_attr, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, expiration_duration, IS_LONG, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_K2hdkc_remove, 0, 1, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_K2hdkc_removeSubkeys, 0, 2, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, subkeys, IS_ARRAY, 0) - ZEND_ARG_TYPE_INFO(0, nested, _IS_BOOL, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_K2hdkc_rename, 0, 2, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, new_key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, parent_key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, is_check_attr, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, expiration_duration, IS_LONG, 0) - ZEND_END_ARG_INFO(); - -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_K2hdkc_setSubkeys, 0, 2, _IS_BOOL, 0) - ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, subkeys, IS_ARRAY, 0) - ZEND_END_ARG_INFO(); - -ZEND_FUNCTION(k2hdkcpx_open); -ZEND_FUNCTION(k2hdkcpx_set_value); -ZEND_FUNCTION(k2hdkcpx_get_value); -ZEND_FUNCTION(k2hdkcpx_add_subkey); -ZEND_FUNCTION(k2hdkcpx_cas_get); -ZEND_FUNCTION(k2hdkcpx_cas_decrement); -ZEND_FUNCTION(k2hdkcpx_cas_increment); -ZEND_FUNCTION(k2hdkcpx_cas_init); -ZEND_FUNCTION(k2hdkcpx_cas_set); -ZEND_FUNCTION(k2hdkcpx_clear_subkeys); -ZEND_FUNCTION(k2hdkcpx_close); -ZEND_FUNCTION(k2hdkcpx_get_attributes); -ZEND_FUNCTION(k2hdkcpx_get_subkeys); -ZEND_FUNCTION(k2hdkcpx_queue_get); -ZEND_FUNCTION(k2hdkcpx_queue_put); -ZEND_FUNCTION(k2hdkcpx_key_queue_get); -ZEND_FUNCTION(k2hdkcpx_key_queue_put); -ZEND_FUNCTION(k2hdkcpx_remove); -ZEND_FUNCTION(k2hdkcpx_remove_subkeys); -ZEND_FUNCTION(k2hdkcpx_rename); -ZEND_FUNCTION(k2hdkcpx_set_subkeys); -ZEND_FUNCTION(k2hdkcpx_bump_debug_level); -ZEND_FUNCTION(k2hdkcpx_set_debug_level_silent); -ZEND_FUNCTION(k2hdkcpx_set_debug_level_error); -ZEND_FUNCTION(k2hdkcpx_set_debug_level_warning); -ZEND_FUNCTION(k2hdkcpx_set_debug_level_message); -ZEND_FUNCTION(k2hdkcpx_set_debug_level_dump); -ZEND_FUNCTION(k2hdkcpx_set_debug_file); -ZEND_FUNCTION(k2hdkcpx_unset_debug_file); -ZEND_FUNCTION(k2hdkcpx_load_debug_env); -ZEND_FUNCTION(k2hdkcpx_is_enable_comlog); -ZEND_FUNCTION(k2hdkcpx_enable_comlog); -ZEND_FUNCTION(k2hdkcpx_disable_comlog); -ZEND_FUNCTION(k2hdkcpx_toggle_comlog); -ZEND_METHOD(K2hdkc, __construct); -ZEND_METHOD(K2hdkc, __destruct); -ZEND_METHOD(K2hdkc, setValue); -ZEND_METHOD(K2hdkc, getValue); -ZEND_METHOD(K2hdkc, addSubkey); -ZEND_METHOD(K2hdkc, casGet); -ZEND_METHOD(K2hdkc, casDecrement); -ZEND_METHOD(K2hdkc, casIncrement); -ZEND_METHOD(K2hdkc, casInit); -ZEND_METHOD(K2hdkc, casSet); -ZEND_METHOD(K2hdkc, clearSubkeys); -ZEND_METHOD(K2hdkc, close); -ZEND_METHOD(K2hdkc, getAttrs); -ZEND_METHOD(K2hdkc, getSubkeys); -ZEND_METHOD(K2hdkc, queueGet); -ZEND_METHOD(K2hdkc, queuePut); -ZEND_METHOD(K2hdkc, keyQueueGet); -ZEND_METHOD(K2hdkc, keyQueuePut); -ZEND_METHOD(K2hdkc, remove); -ZEND_METHOD(K2hdkc, removeSubkeys); -ZEND_METHOD(K2hdkc, rename); -ZEND_METHOD(K2hdkc, setSubkeys); - -static const zend_function_entry ext_functions[] = { - ZEND_FE(k2hdkcpx_open, arginfo_k2hdkcpx_open) - ZEND_FE(k2hdkcpx_set_value, arginfo_k2hdkcpx_set_value) - ZEND_FE(k2hdkcpx_get_value, arginfo_k2hdkcpx_get_value) - ZEND_FE(k2hdkcpx_add_subkey, arginfo_k2hdkcpx_add_subkey) - ZEND_FE(k2hdkcpx_cas_get, arginfo_k2hdkcpx_cas_get) - ZEND_FE(k2hdkcpx_cas_decrement, arginfo_k2hdkcpx_cas_decrement) - ZEND_FE(k2hdkcpx_cas_increment, arginfo_k2hdkcpx_cas_increment) - ZEND_FE(k2hdkcpx_cas_init, arginfo_k2hdkcpx_cas_init) - ZEND_FE(k2hdkcpx_cas_set, arginfo_k2hdkcpx_cas_set) - ZEND_FE(k2hdkcpx_clear_subkeys, arginfo_k2hdkcpx_clear_subkeys) - ZEND_FE(k2hdkcpx_close, arginfo_k2hdkcpx_close) - ZEND_FE(k2hdkcpx_get_attributes, arginfo_k2hdkcpx_get_attributes) - ZEND_FE(k2hdkcpx_get_subkeys, arginfo_k2hdkcpx_get_subkeys) - ZEND_FE(k2hdkcpx_queue_get, arginfo_k2hdkcpx_queue_get) - ZEND_FE(k2hdkcpx_queue_put, arginfo_k2hdkcpx_queue_put) - ZEND_FE(k2hdkcpx_key_queue_get, arginfo_k2hdkcpx_key_queue_get) - ZEND_FE(k2hdkcpx_key_queue_put, arginfo_k2hdkcpx_key_queue_put) - ZEND_FE(k2hdkcpx_remove, arginfo_k2hdkcpx_remove) - ZEND_FE(k2hdkcpx_remove_subkeys, arginfo_k2hdkcpx_remove_subkeys) - ZEND_FE(k2hdkcpx_rename, arginfo_k2hdkcpx_rename) - ZEND_FE(k2hdkcpx_set_subkeys, arginfo_k2hdkcpx_set_subkeys) - ZEND_FE(k2hdkcpx_bump_debug_level, arginfo_k2hdkcpx_bump_debug_level) - ZEND_FE(k2hdkcpx_set_debug_level_silent, arginfo_k2hdkcpx_set_debug_level_silent) - ZEND_FE(k2hdkcpx_set_debug_level_error, arginfo_k2hdkcpx_set_debug_level_error) - ZEND_FE(k2hdkcpx_set_debug_level_warning, arginfo_k2hdkcpx_set_debug_level_warning) - ZEND_FE(k2hdkcpx_set_debug_level_message, arginfo_k2hdkcpx_set_debug_level_message) - ZEND_FE(k2hdkcpx_set_debug_level_dump, arginfo_k2hdkcpx_set_debug_level_dump) - ZEND_FE(k2hdkcpx_set_debug_file, arginfo_k2hdkcpx_set_debug_file) - ZEND_FE(k2hdkcpx_unset_debug_file, arginfo_k2hdkcpx_unset_debug_file) - ZEND_FE(k2hdkcpx_load_debug_env, arginfo_k2hdkcpx_load_debug_env) - ZEND_FE(k2hdkcpx_is_enable_comlog, arginfo_k2hdkcpx_is_enable_comlog) - ZEND_FE(k2hdkcpx_enable_comlog, arginfo_k2hdkcpx_enable_comlog) - ZEND_FE(k2hdkcpx_disable_comlog, arginfo_k2hdkcpx_disable_comlog) - ZEND_FE(k2hdkcpx_toggle_comlog, arginfo_k2hdkcpx_toggle_comlog) - ZEND_FE_END -}; - -static const zend_function_entry class_K2hdkc_methods[] = { - ZEND_ME(K2hdkc, __construct, arginfo_class_K2hdkc___construct, ZEND_ACC_PUBLIC) - ZEND_ME(K2hdkc, __destruct, arginfo_class_K2hdkc___destruct, ZEND_ACC_PUBLIC) - ZEND_ME(K2hdkc, setValue, arginfo_class_K2hdkc_setValue, ZEND_ACC_PUBLIC) - ZEND_ME(K2hdkc, getValue, arginfo_class_K2hdkc_getValue, ZEND_ACC_PUBLIC) - ZEND_ME(K2hdkc, addSubkey, arginfo_class_K2hdkc_addSubkey, ZEND_ACC_PUBLIC) - ZEND_ME(K2hdkc, casGet, arginfo_class_K2hdkc_casGet, ZEND_ACC_PUBLIC) - ZEND_ME(K2hdkc, casDecrement, arginfo_class_K2hdkc_casDecrement, ZEND_ACC_PUBLIC) - ZEND_ME(K2hdkc, casIncrement, arginfo_class_K2hdkc_casIncrement, ZEND_ACC_PUBLIC) - ZEND_ME(K2hdkc, casInit, arginfo_class_K2hdkc_casInit, ZEND_ACC_PUBLIC) - ZEND_ME(K2hdkc, casSet, arginfo_class_K2hdkc_casSet, ZEND_ACC_PUBLIC) - ZEND_ME(K2hdkc, clearSubkeys, arginfo_class_K2hdkc_clearSubkeys, ZEND_ACC_PUBLIC) - ZEND_ME(K2hdkc, close, arginfo_class_K2hdkc_close, ZEND_ACC_PUBLIC) - ZEND_ME(K2hdkc, getAttrs, arginfo_class_K2hdkc_getAttrs, ZEND_ACC_PUBLIC) - ZEND_ME(K2hdkc, getSubkeys, arginfo_class_K2hdkc_getSubkeys, ZEND_ACC_PUBLIC) - ZEND_ME(K2hdkc, queueGet, arginfo_class_K2hdkc_queueGet, ZEND_ACC_PUBLIC) - ZEND_ME(K2hdkc, queuePut, arginfo_class_K2hdkc_queuePut, ZEND_ACC_PUBLIC) - ZEND_ME(K2hdkc, keyQueueGet, arginfo_class_K2hdkc_keyQueueGet, ZEND_ACC_PUBLIC) - ZEND_ME(K2hdkc, keyQueuePut, arginfo_class_K2hdkc_keyQueuePut, ZEND_ACC_PUBLIC) - ZEND_ME(K2hdkc, remove, arginfo_class_K2hdkc_remove, ZEND_ACC_PUBLIC) - ZEND_ME(K2hdkc, removeSubkeys, arginfo_class_K2hdkc_removeSubkeys, ZEND_ACC_PUBLIC) - ZEND_ME(K2hdkc, rename, arginfo_class_K2hdkc_rename, ZEND_ACC_PUBLIC) - ZEND_ME(K2hdkc, setSubkeys, arginfo_class_K2hdkc_setSubkeys, ZEND_ACC_PUBLIC) - ZEND_FE_END -}; - -static void register_k2hdkcpx_symbols(int module_number) -{ - REGISTER_LONG_CONSTANT("K2HDKC_INVALID_HANDLE", K2HDKC_INVALID_HANDLE, CONST_PERSISTENT); -} - -static zend_class_entry *register_class_K2hdkc(void) -{ - zend_class_entry ce, *class_entry; - - INIT_CLASS_ENTRY(ce, "K2hdkc", class_K2hdkc_methods); - class_entry = zend_register_internal_class_ex(&ce, NULL); - zend_register_class_alias("K2hdkcPx", class_entry); - - zval property__config_file_default_value; - ZVAL_UNDEF(&property__config_file_default_value); - zend_string *property__config_file_name = zend_string_init("_config_file", sizeof("_config_file") - 1, 1); - zend_declare_typed_property(class_entry, property__config_file_name, &property__config_file_default_value, ZEND_ACC_PRIVATE, NULL, ZEND_TYPE_ENCODE(IS_STRING, "")); - zend_string_release(property__config_file_name); - - zval property__port_default_value; - ZVAL_UNDEF(&property__port_default_value); - zend_string *property__port_name = zend_string_init("_port", sizeof("_port") - 1, 1); - zend_declare_typed_property(class_entry, property__port_name, &property__port_default_value, ZEND_ACC_PRIVATE, NULL, ZEND_TYPE_ENCODE(IS_LONG, 0)); - zend_string_release(property__port_name); - - zval property__cuk_default_value; - ZVAL_UNDEF(&property__cuk_default_value); - zend_string *property__cuk_name = zend_string_init("_cuk", sizeof("_cuk") - 1, 1); - zend_declare_typed_property(class_entry, property__cuk_name, &property__cuk_default_value, ZEND_ACC_PRIVATE, NULL, ZEND_TYPE_ENCODE(IS_STRING, "")); - zend_string_release(property__cuk_name); - - zval property__rejoin_default_value; - ZVAL_UNDEF(&property__rejoin_default_value); - zend_string *property__rejoin_name = zend_string_init("_rejoin", sizeof("_rejoin") - 1, 1); - zend_declare_typed_property(class_entry, property__rejoin_name, &property__rejoin_default_value, ZEND_ACC_PRIVATE, NULL, ZEND_TYPE_ENCODE(IS_LONG, 1)); - zend_string_release(property__rejoin_name); - - zval property__rejoin_forever_default_value; - ZVAL_UNDEF(&property__rejoin_forever_default_value); - zend_string *property__rejoin_forever_name = zend_string_init("_rejoin_forever", sizeof("_rejoin_forever") - 1, 1); - zend_declare_typed_property(class_entry, property__rejoin_forever_name, &property__rejoin_forever_default_value, ZEND_ACC_PRIVATE, NULL, ZEND_TYPE_ENCODE(IS_LONG, 1)); - zend_string_release(property__rejoin_forever_name); - - zval property__clear_backup_default_value; - ZVAL_UNDEF(&property__clear_backup_default_value); - zend_string *property__clear_backup_name = zend_string_init("_clear_backup", sizeof("_clear_backup") - 1, 1); - zend_declare_typed_property(class_entry, property__clear_backup_name, &property__clear_backup_default_value, ZEND_ACC_PRIVATE, NULL, ZEND_TYPE_ENCODE(IS_LONG, 1)); - zend_string_release(property__clear_backup_name); - - zval property__handle_default_value; - ZVAL_NULL(&property__handle_default_value); - zend_string *property__handle_name = zend_string_init("_handle", sizeof("_handle") - 1, 1); - zend_declare_property_ex(class_entry, property__handle_name, &property__handle_default_value, ZEND_ACC_PRIVATE, NULL); - zend_string_release(property__handle_name); - - return class_entry; -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noexpandtab sw=4 ts=4 fdm=marker - * vim<600: noexpandtab sw=4 ts=4 - */ diff --git a/k2hdkcpx_compat.h b/k2hdkcpx_compat.h deleted file mode 100644 index 8b81b73..0000000 --- a/k2hdkcpx_compat.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -* -* K2HDKC PHP Extension library -* -* Copyright 2023 Yahoo Japan Corporation. -* -* K2HDKC is k2hash based distributed KVS cluster. -* K2HDKC uses K2HASH, CHMPX, FULLOCK libraries. K2HDKC supports -* distributed KVS cluster server program and client libraries. -* -* For the full copyright and license information, please view -* the license file that was distributed with this source code. -* -* AUTHOR: Hirotaka Wakabayashi -* CREATE: Fri, Mar 31 2023 -* REVISION: -* -*/ - -#if PHP_VERSION_ID < 80000 -#include "k2hdkcpx_arginfo_php7.h" -#else -#include "k2hdkcpx_arginfo.h" -#endif - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noexpandtab sw=4 ts=4 fdm=marker - * vim<600: noexpandtab sw=4 ts=4 - */ diff --git a/k2hdkcpx_func.c b/k2hdkcpx_func.c index 2620922..d1b95c7 100644 --- a/k2hdkcpx_func.c +++ b/k2hdkcpx_func.c @@ -27,7 +27,7 @@ // cppcheck-suppress missingInclude #include "ext/standard/info.h" #include "php_k2hdkcpx.h" -#include "k2hdkcpx_compat.h" +#include "k2hdkcpx_arginfo.h" /* For compatibility with older PHP versions */ #ifndef ZEND_PARSE_PARAMETERS_NONE