summaryrefslogtreecommitdiff
path: root/dev-php/pecl-memcache
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2021-12-05 02:47:11 +0000
committerV3n3RiX <venerix@koprulu.sector>2021-12-05 02:47:11 +0000
commit2771f79232c273bc2a57d23bf335dd81ccf6af28 (patch)
treec8af0fd04194aed03cf067d44e53c7edd3e9ab84 /dev-php/pecl-memcache
parente9d044d4b9b71200a96adfa280848858c0f468c9 (diff)
gentoo resync : 05.12.2021
Diffstat (limited to 'dev-php/pecl-memcache')
-rw-r--r--dev-php/pecl-memcache/Manifest4
-rw-r--r--dev-php/pecl-memcache/files/8.0-patches-20211123.patch204
-rw-r--r--dev-php/pecl-memcache/pecl-memcache-4.0.5.2-r1.ebuild3
-rw-r--r--dev-php/pecl-memcache/pecl-memcache-8.0-r1.ebuild67
4 files changed, 276 insertions, 2 deletions
diff --git a/dev-php/pecl-memcache/Manifest b/dev-php/pecl-memcache/Manifest
index d2d156c2b789..6c6cfa482db8 100644
--- a/dev-php/pecl-memcache/Manifest
+++ b/dev-php/pecl-memcache/Manifest
@@ -1,5 +1,7 @@
+AUX 8.0-patches-20211123.patch 5706 BLAKE2B 66b9671357963c0f7c0f32f3b578f4b38acda7024e8c33bb03e328b4177c20841b8318482122b343d407d6dc5e4182d8fc74ae3dfc186ad8d606372d024a4807 SHA512 6e66664ca4aa7d3578facbdad012506b3b12fdae7460c9cad5f515228f697e511bbb02fe7f9a2efcfc3066877688bd7092e81a26199d5e26097f365806079eab
DIST memcache-4.0.5.2.tgz 75061 BLAKE2B fbf96fd182ff4b8764c4492edcdac53263176ebe6d63a27e9f3fb32110a016b221722c246e7c1ae49ee973a6e4cdff045876d1c6119f410f2fa3e796c0580e02 SHA512 93e163acf3a6c28f16b5f0982105f6f558cceeb314b3f09ad71655d8a5adf64d23959f1a2f3589eb7e7a7e18c88ba8132014e13f697a737cd570cf9405137384
DIST memcache-8.0.tgz 78448 BLAKE2B fb2d68d5ff4c6343dd2e66ae5c3f84fed22455b8614dce04dde2e10c164bf1f8d276776b74beaa387dd794cf82f6b897a88c8bed058376b9032e0452c2e94b06 SHA512 d5eea13b85d8d35ef6aab8c5699bdcc4707cf8debf4052cbbeac26e7e2360a4d3d4e55e8bd0b40cf19fe014ba1fc42d5417deabbe22a199f0c6aa98b67d132d4
-EBUILD pecl-memcache-4.0.5.2-r1.ebuild 1805 BLAKE2B e32b359ffd8172d00d49d48b3ae4c4e24e8480dc435f1b16db4a93caf6d732ab78a9fc3381af89c976e499b910d07e6130f33ec5f7223002e4eec246d982cae5 SHA512 40fe55730d2dfddb278bc5a6ccc055dfe40a34a7ff780a29022a563e28adb3f054cb5e7d99010aa240827cd6558e9ce383f1d7b0c077e0afc81d71b39178ec4b
+EBUILD pecl-memcache-4.0.5.2-r1.ebuild 1885 BLAKE2B b7eb2414249e1f70cdaae0bc8b72e844d0af77630b9fe1eca66cd85d7ed3627877266712546638d212a940e1bac7c2f6f5f6e2d8df969434de08e4e2e1e7f2c2 SHA512 880c12ae73ca9d657471c322c89e2fc3e3a84facd213af91b03533d2a46173eeaa3698112698d8ca78c3a53f8fa0cd9bfc6182516e124bb7b88c1486d02789a7
+EBUILD pecl-memcache-8.0-r1.ebuild 1942 BLAKE2B 56b4ffb0ef6db116d9190b01bb1ec0b9a1841435afe36809f777882978fbcff2ddb4df0b2385c173634c5e7fb97abdbcf4e7616610768281779c9532b0bb0e9a SHA512 5e4409632b5e953f63df237ee428db8a41e668fb39149b2707d60ccc7d10e74a039ee935e05b7dde4c8cc253d35fed73fbe126b0f35546225caf5788a14a2ef6
EBUILD pecl-memcache-8.0.ebuild 1755 BLAKE2B 0c765afbcdda82b52c5eac24b06dfbba5d2864a7f0673dc0c1cc88931ef9355a1b914ee97dedbc821a1213b5b564d59402525e0c8d77538a5d35911b55f29b61 SHA512 b32040a18f5b898afbb1cb8297e4de732973cb9c3863b7485dac2d05ab3b311351f2b3d9e6ad0608bdfce2ed54daa252557a91ee7ecc5bb37c2e802b45fbaa29
MISC metadata.xml 240 BLAKE2B f60f325331d493a555e53c29c7cf2742a415356da28a467505f1441f3fd790fd0d59050df84854bdc379d19d94a46121216479807975a2922d5a2fefde83416b SHA512 fada9d69055f2be962b95aac82f260ec5db7a3f4392d10f0458a1d125938fa17539f7ec486000f3a95cff85a3fbb6bbf1f6f4fe6c2de7aa420a7543a3e89d03e
diff --git a/dev-php/pecl-memcache/files/8.0-patches-20211123.patch b/dev-php/pecl-memcache/files/8.0-patches-20211123.patch
new file mode 100644
index 000000000000..9005ac5feef3
--- /dev/null
+++ b/dev-php/pecl-memcache/files/8.0-patches-20211123.patch
@@ -0,0 +1,204 @@
+diff --git a/Dockerfile b/Dockerfile
+index a52759e..506c28a 100644
+--- a/Dockerfile
++++ b/Dockerfile
+@@ -1,10 +1,13 @@
+ ARG PHP_IMAGE=php:8.0
+ FROM $PHP_IMAGE
+
++RUN docker-php-ext-configure pcntl --enable-pcntl \
++ && docker-php-ext-install -j$(nproc) pcntl
++
+ RUN apt-get update && apt-get install -y \
+ git \
+ zlib1g-dev \
+- memcached ;
++ memcached ;
+
+ COPY docker/host.conf /etc/host.conf
+
+diff --git a/README b/README
+index b36fa46..07f8f89 100644
+--- a/README
++++ b/README
+@@ -3,7 +3,7 @@ This is an official repository for pecl-memcache plugin since 2019.
+ This repository contains modified pecl-memcache plugin ported to PHP8,
+ which was originally developed for the need of hosting company in Slovakia (Websupport.sk).
+
+-The latest release is 8.0 (released: 2020-12-06) with support for PHP 8.0.
++The latest release is 8.0 (released: 2020-12-06) with support for PHP 8.0 and unofficial support for PHP 7.3 and 7.4
+
+ Please use version 4.0.5.1 (released: 2020-12-19) for PHP 7.x from branch NON_BLOCKING_IO_php7.
+
+diff --git a/Vagrantfile b/Vagrantfile
+new file mode 100644
+index 0000000..8665890
+--- /dev/null
++++ b/Vagrantfile
+@@ -0,0 +1,17 @@
++# -*- mode: ruby -*-
++# vi: set ft=ruby :
++
++VAGRANTFILE_API_VERSION = '2'
++
++Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
++ config.vm.box = 'ubuntu/bionic64'
++
++ config.vm.provider :virtualbox do |vb|
++ vb.name = 'ext-memcache-dev'
++ vb.memory = 1024
++ vb.cpus = 2
++ end
++
++ config.vm.provision 'docker'
++
++end
+diff --git a/src/memcache.c b/src/memcache.c
+index 7c3a660..2cb675b 100644
+--- a/src/memcache.c
++++ b/src/memcache.c
+@@ -924,7 +924,7 @@ static void php_mmc_store(INTERNAL_FUNCTION_PARAMETERS, int op) /* {{{ */
+ continue;
+ }
+
+- /* begin sending requests immediatly */
++ /* begin sending requests immediately */
+ mmc_pool_select(pool);
+ } ZEND_HASH_FOREACH_END();
+ }
+@@ -1089,7 +1089,7 @@ static void php_mmc_numeric(INTERNAL_FUNCTION_PARAMETERS, int deleted, int inver
+ continue;
+ }
+
+- /* begin sending requests immediatly */
++ /* begin sending requests immediately */
+ mmc_pool_select(pool);
+ } ZEND_HASH_FOREACH_END();
+
+@@ -1319,8 +1319,9 @@ static void php_mmc_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool persistent)
+ size_t host_len;
+ zend_long tcp_port = MEMCACHE_G(default_port);
+ double timeout = MMC_DEFAULT_TIMEOUT;
++ zend_bool null_port;
+
+- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ld", &host, &host_len, &tcp_port, &timeout) == FAILURE) {
++ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l!d", &host, &host_len, &tcp_port, &null_port, &timeout) == FAILURE) {
+ return;
+ }
+
+@@ -2492,7 +2493,7 @@ PHP_FUNCTION(memcache_flush)
+ pool->protocol->flush(request, delay);
+
+ if (mmc_pool_schedule(pool, pool->servers[i], request) == MMC_OK) {
+- /* begin sending requests immediatly */
++ /* begin sending requests immediately */
+ mmc_pool_select(pool);
+ }
+ }
+diff --git a/src/memcache_pool.c b/src/memcache_pool.c
+index 733a0c5..e52389d 100644
+--- a/src/memcache_pool.c
++++ b/src/memcache_pool.c
+@@ -1303,7 +1303,7 @@ int mmc_pool_schedule_get(
+ pool->protocol->end_get(mmc->buildreq);
+ mmc_pool_schedule(pool, mmc, mmc->buildreq);
+
+- /* begin sending requests immediatly */
++ /* begin sending requests immediately */
+ mmc_pool_select(pool);
+
+ mmc->buildreq = mmc_pool_request_get(
+diff --git a/src/memcache_session.c b/src/memcache_session.c
+index e4a80de..d3aab24 100644
+--- a/src/memcache_session.c
++++ b/src/memcache_session.c
+@@ -319,7 +319,7 @@ PS_READ_FUNC(memcache)
+ ZVAL_NULL(&addresult);
+
+ /* third request fetches the data, data is only valid if either of the lock requests succeeded */
+- ZVAL_EMPTY_STRING(&dataresult);
++ ZVAL_NULL(&dataresult);
+
+ /* create requests */
+ if (php_mmc_session_read_request(pool, &zkey, lockparam, &addresult, dataparam, &lockrequest, &addrequest, &datarequest) != MMC_OK) {
+diff --git a/tests/redundancy_test.phpt b/tests/redundancy_test.phpt
+new file mode 100644
+index 0000000..fb5ab84
+--- /dev/null
++++ b/tests/redundancy_test.phpt
+@@ -0,0 +1,75 @@
++--TEST--
++redundancy test
++--SKIPIF--
++<?php include 'connect.inc'; if (!MEMCACHE_HAVE_SESSION) print 'skip not compiled with session support'; else if (!function_exists('pcntl_fork')) print 'skip not compiled with pcntl_fork() support'; ?>
++--FILE--
++<?php
++
++include 'connect.inc';
++
++$sid = md5(rand());
++
++ini_set('session.save_handler', 'memcache');
++ini_set('memcache.session_save_path', "tcp://$host:$port,tcp://$host2:$port2");
++ini_set('memcache.session_redundancy', 3);
++
++$memcache1 = test_connect1();
++$memcache2 = test_connect2();
++
++$pid = pcntl_fork();
++if (!$pid) {
++ // In child process
++ session_id($sid);
++ session_start();
++ if (!isset($_SESSION['counter']))
++ $_SESSION['counter'] = 0;
++ $_SESSION['counter'] += 1;
++ session_write_close();
++
++ exit(0);
++}
++pcntl_waitpid($pid, $status);
++
++$memcache1->flush();
++
++$pid = pcntl_fork();
++if (!$pid) {
++ // In child process
++ session_id($sid);
++ session_start();
++ if (!isset($_SESSION['counter']))
++ $_SESSION['counter'] = 0;
++ $_SESSION['counter'] += 1;
++ session_write_close();
++
++ exit(0);
++}
++pcntl_waitpid($pid, $status);
++
++$memcache2->flush();
++
++$pid = pcntl_fork();
++if (!$pid) {
++ // In child process
++ session_id($sid);
++ session_start();
++ if (!isset($_SESSION['counter']))
++ $_SESSION['counter'] = 0;
++ $_SESSION['counter'] += 1;
++ session_write_close();
++
++ exit(0);
++}
++pcntl_waitpid($pid, $status);
++
++
++session_id($sid);
++session_start();
++var_dump($_SESSION);
++
++?>
++--EXPECT--
++array(1) {
++ ["counter"]=>
++ int(3)
++}
diff --git a/dev-php/pecl-memcache/pecl-memcache-4.0.5.2-r1.ebuild b/dev-php/pecl-memcache/pecl-memcache-4.0.5.2-r1.ebuild
index 10134a07db4d..240a4d9d5754 100644
--- a/dev-php/pecl-memcache/pecl-memcache-4.0.5.2-r1.ebuild
+++ b/dev-php/pecl-memcache/pecl-memcache-4.0.5.2-r1.ebuild
@@ -9,7 +9,7 @@ PHP_EXT_NEEDED_USE="session(-)?"
DOCS=( README example.php )
HTML_DOCS=( memcache.php )
-USE_PHP="php7-3 php7-4 php8-0"
+USE_PHP="php7-3 php7-4 php8-0 php8-1"
inherit php-ext-pecl-r3
@@ -25,6 +25,7 @@ IUSE="+session"
DEPEND="php_targets_php7-3? ( sys-libs/zlib ) php_targets_php7-4? ( sys-libs/zlib )"
RDEPEND="${DEPEND}
php_targets_php8-0? ( dev-php/pecl-memcache:8[php_targets_php8-0(-)?] )
+ php_targets_php8-1? ( dev-php/pecl-memcache:8[php_targets_php8-1(-)?] )
"
# The test suite requires memcached to be running.
diff --git a/dev-php/pecl-memcache/pecl-memcache-8.0-r1.ebuild b/dev-php/pecl-memcache/pecl-memcache-8.0-r1.ebuild
new file mode 100644
index 000000000000..ec0fa315424c
--- /dev/null
+++ b/dev-php/pecl-memcache/pecl-memcache-8.0-r1.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+PHP_EXT_NAME="memcache"
+PHP_EXT_INI="yes"
+PHP_EXT_ZENDEXT="no"
+PHP_EXT_NEEDED_USE="session(-)?"
+DOCS=( README example.php )
+HTML_DOCS=( memcache.php )
+
+USE_PHP="php7-3 php7-4 php8-0 php8-1"
+
+inherit php-ext-pecl-r3
+
+USE_PHP="php8-0 php8-1"
+
+KEYWORDS="~amd64 ~hppa ~ppc64 ~x86"
+
+DESCRIPTION="PHP extension for using memcached"
+LICENSE="PHP-3"
+SLOT="8"
+IUSE="+session"
+
+DEPEND="
+ php_targets_php8-0? ( sys-libs/zlib )
+ php_targets_php8-1? ( sys-libs/zlib )
+"
+RDEPEND="${DEPEND}
+ php_targets_php7-3? ( dev-php/pecl-memcache:7[php_targets_php7-3(-)?] )
+ php_targets_php7-4? ( dev-php/pecl-memcache:7[php_targets_php7-4(-)?] )
+"
+
+# The test suite requires memcached to be running.
+RESTRICT='test'
+PATCHES=( "${FILESDIR}/8.0-patches-20211123.patch" )
+
+src_prepare() {
+ if use php_targets_php8-0 || use php_targets_php8-1 ; then
+ php-ext-source-r3_src_prepare
+ else
+ default
+ fi
+}
+
+src_configure() {
+ if use php_targets_php8-0 || use php_targets_php8-1 ; then
+ local PHP_EXT_ECONF_ARGS=( --enable-memcache --with-zlib-dir="${EPREFIX}/usr" $(use_enable session memcache-session) )
+ php-ext-source-r3_src_configure
+ fi
+}
+
+src_install() {
+ if use php_targets_php8-0 || use php_targets_php8-1 ; then
+ php-ext-pecl-r3_src_install
+
+ php-ext-source-r3_addtoinifiles "memcache.allow_failover" "true"
+ php-ext-source-r3_addtoinifiles "memcache.max_failover_attempts" "20"
+ php-ext-source-r3_addtoinifiles "memcache.chunk_size" "32768"
+ php-ext-source-r3_addtoinifiles "memcache.default_port" "11211"
+ php-ext-source-r3_addtoinifiles "memcache.hash_strategy" "consistent"
+ php-ext-source-r3_addtoinifiles "memcache.hash_function" "crc32"
+ php-ext-source-r3_addtoinifiles "memcache.redundancy" "1"
+ php-ext-source-r3_addtoinifiles "memcache.session_redundancy" "2"
+ php-ext-source-r3_addtoinifiles "memcache.protocol" "ascii"
+ fi
+}