diff options
-rw-r--r-- | 1365.patch | 67 | ||||
-rw-r--r-- | 1366.patch | 23 | ||||
-rw-r--r-- | REFLECTION | 2 | ||||
-rw-r--r-- | getSessionData.php | 22 | ||||
-rw-r--r-- | php-pecl-redis4.spec | 25 | ||||
-rw-r--r-- | regenerateSessionId.php | 84 | ||||
-rw-r--r-- | startSession.php | 41 |
7 files changed, 10 insertions, 254 deletions
diff --git a/1365.patch b/1365.patch deleted file mode 100644 index bc6beb8..0000000 --- a/1365.patch +++ /dev/null @@ -1,67 +0,0 @@ -From c4e4248dbe3352274304e766d6020a4c319fdef6 Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@remirepo.net> -Date: Fri, 8 Jun 2018 10:46:04 +0200 -Subject: [PATCH] use PHP_BINARY instead of php and allow override honours - TEST_PHP_EXECUTABLE and TEST_PHP_ARGS (as standard php tests) - ---- - tests/RedisTest.php | 27 +++++++++++++++++++++++---- - 1 file changed, 23 insertions(+), 4 deletions(-) - -diff --git a/tests/RedisTest.php b/tests/RedisTest.php -index ff0b7537..cdfa5fd3 100644 ---- a/tests/RedisTest.php -+++ b/tests/RedisTest.php -@@ -5560,9 +5560,8 @@ private function startSessionProcess($sessionId, $sleepTime, $background, $maxEx - } - $commandParameters = array_map('escapeshellarg', $commandParameters); - -- $command = 'php ' . __DIR__ . '/startSession.php ' . implode(' ', $commandParameters); -+ $command = self::getPhpCommand('startSession.php') . implode(' ', $commandParameters); - $command .= $background ? ' 2>/dev/null > /dev/null &' : ' 2>&1'; -- - exec($command, $output); - return ($background || (count($output) == 1 && $output[0] == 'SUCCESS')) ? true : false; - } -@@ -5576,7 +5575,7 @@ private function startSessionProcess($sessionId, $sleepTime, $background, $maxEx - */ - private function getSessionData($sessionId, $sessionLifetime = 1440) - { -- $command = 'php ' . __DIR__ . '/getSessionData.php ' . escapeshellarg($this->getFullHostPath()) . ' ' . $this->sessionSaveHandler . ' ' . escapeshellarg($sessionId) . ' ' . escapeshellarg($sessionLifetime); -+ $command = self::getPhpCommand('getSessionData.php') . escapeshellarg($this->getFullHostPath()) . ' ' . $this->sessionSaveHandler . ' ' . escapeshellarg($sessionId) . ' ' . escapeshellarg($sessionLifetime); - exec($command, $output); - - return $output[0]; -@@ -5594,11 +5593,31 @@ private function regenerateSessionId($sessionId, $locking = false, $destroyPrevi - { - $args = array_map('escapeshellarg', array($sessionId, $locking, $destroyPrevious, $sessionProxy)); - -- $command = 'php --no-php-ini --define extension=igbinary.so --define extension=' . __DIR__ . '/../modules/redis.so ' . __DIR__ . '/regenerateSessionId.php ' . escapeshellarg($this->getFullHostPath()) . ' ' . $this->sessionSaveHandler . ' ' . implode(' ', $args); -+ $command = self::getPhpCommand('regenerateSessionId.php') . escapeshellarg($this->getFullHostPath()) . ' ' . $this->sessionSaveHandler . ' ' . implode(' ', $args); - - exec($command, $output); - - return $output[0]; - } -+ -+ /** -+ * Return command to launch PHP with built extension enabled -+ * taking care of environment (TEST_PHP_EXECUTABLE and TEST_PHP_ARGS) -+ * -+ * @param string $script -+ * -+ * @return string -+ */ -+ private function getPhpCommand($script) -+ { -+ static $cmd = NULL; -+ -+ if (!$cmd) { -+ $cmd = (getenv('TEST_PHP_EXECUTABLE') ?: (defined('PHP_BINARY') ? PHP_BINARY : 'php')); // PHP_BINARY is 5.4+ -+ $cmd .= ' '; -+ $cmd .= (getenv('TEST_PHP_ARGS') ?: '--no-php-ini --define extension=igbinary.so --define extension=' . dirname(__DIR__) . '/modules/redis.so'); -+ } -+ return $cmd . ' ' . __DIR__ . '/' . $script . ' '; -+ } - } - ?> diff --git a/1366.patch b/1366.patch deleted file mode 100644 index f3d5f37..0000000 --- a/1366.patch +++ /dev/null @@ -1,23 +0,0 @@ -From ff32a634151fd471cbd5b39e26cd56af63fe7ea5 Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@remirepo.net> -Date: Fri, 8 Jun 2018 16:16:53 +0200 -Subject: [PATCH] Fix: Warning: time() expects exactly 0 parameters, 1 given - ... (php 7.3) - ---- - tests/RedisTest.php | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tests/RedisTest.php b/tests/RedisTest.php -index ff0b7537..e48309d5 100644 ---- a/tests/RedisTest.php -+++ b/tests/RedisTest.php -@@ -452,7 +452,7 @@ public function testSetTimeout() { - public function testExpireAt() { - $this->redis->del('key'); - $this->redis->set('key', 'value'); -- $now = time(NULL); -+ $now = time(); - $this->redis->expireAt('key', $now + 1); - $this->assertEquals('value', $this->redis->get('key')); - sleep(2); @@ -1,4 +1,4 @@ -Extension [ <persistent> extension #192 redis version 4.1.0RC1 ] { +Extension [ <persistent> extension #192 redis version 4.1.0RC3 ] { - Dependencies { Dependency [ igbinary (Required) ] diff --git a/getSessionData.php b/getSessionData.php deleted file mode 100644 index d49256c..0000000 --- a/getSessionData.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -error_reporting(E_ERROR | E_WARNING); - -$redisHost = $argv[1]; -$saveHandler = $argv[2]; -$sessionId = $argv[3]; -$sessionLifetime = $argv[4]; - -if (empty($redisHost)) { - $redisHost = 'tcp://localhost:6379'; -} - -ini_set('session.save_handler', $saveHandler); -ini_set('session.save_path', $redisHost); -ini_set('session.gc_maxlifetime', $sessionLifetime); - -session_id($sessionId); -if (!session_start()) { - echo "session_start() was nut successful"; -} else { - echo isset($_SESSION['redis_test']) ? $_SESSION['redis_test'] : 'Key redis_test not found'; -} diff --git a/php-pecl-redis4.spec b/php-pecl-redis4.spec index 78d5d49..3b0ae48 100644 --- a/php-pecl-redis4.spec +++ b/php-pecl-redis4.spec @@ -29,26 +29,16 @@ %global ini_name 50-%{pecl_name}.ini %endif %global upstream_version 4.1.0 -%global upstream_prever RC1 +%global upstream_prever RC3 Summary: Extension for communicating with the Redis key-value store Name: %{?sub_prefix}php-pecl-redis4 Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} -Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Source0: http://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz License: PHP URL: http://pecl.php.net/package/redis -# See https://github.com/phpredis/phpredis/issues/1364 -Source1: https://raw.githubusercontent.com/phpredis/phpredis/develop/tests/regenerateSessionId.php -Source2: https://raw.githubusercontent.com/phpredis/phpredis/develop/tests/getSessionData.php -Source3: https://raw.githubusercontent.com/phpredis/phpredis/develop/tests/startSession.php - -# See https://github.com/phpredis/phpredis/pull/1365 -Patch0: 1365.patch -# See https://github.com/phpredis/phpredis/pull/1366 -Patch1: 1366.patch - BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel BuildRequires: %{?scl_prefix}php-pear @@ -59,6 +49,8 @@ BuildRequires: liblzf-devel # to run Test suite %if %{with_tests} BuildRequires: redis >= 3 +# Temporary +BuildRequires: jemalloc %endif Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} @@ -133,9 +125,6 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS -cp %{SOURCE1} %{SOURCE2} %{SOURCE3} tests/ -%patch0 -p1 -b .pr1365 -%patch1 -p1 -b .pr1366 # Use system library rm -r liblzf @@ -339,13 +328,17 @@ fi %changelog +* Fri Jun 22 2018 Remi Collet <remi@remirepo.net> - 4.1.0~RC3-1 +- update to 4.1.0RC3 (beta, no change) +- drop patches merged upstream + * Fri Jun 8 2018 Remi Collet <remi@remirepo.net> - 4.1.0~RC1-2 - test build with 7.3 - open https://github.com/phpredis/phpredis/pull/1366 Fix: Warning: time() expects exactly 0 parameters, 1 given ... * Fri Jun 8 2018 Remi Collet <remi@remirepo.net> - 4.1.0~RC1-1 -- update to 4.1.0RC1 +- update to 4.1.0RC1 (alpha) - open https://github.com/phpredis/phpredis/pull/1365 use PHP_BINARY instead of php and allow override - report https://github.com/phpredis/phpredis/issues/1364 diff --git a/regenerateSessionId.php b/regenerateSessionId.php deleted file mode 100644 index f0e4c4e..0000000 --- a/regenerateSessionId.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php -error_reporting(E_ERROR | E_WARNING); - -$redisHost = $argv[1]; -$saveHandler = $argv[2]; -$sessionId = $argv[3]; -$locking = !!$argv[4]; -$destroyPrevious = !!$argv[5]; -$sessionProxy = !!$argv[6]; - -if (empty($redisHost)) { - $redisHost = 'tcp://localhost:6379'; -} - -ini_set('session.save_handler', $saveHandler); -ini_set('session.save_path', $redisHost); - -if ($locking) { - ini_set('redis.session.locking_enabled', true); -} - -if (interface_exists('SessionHandlerInterface')) { - class TestHandler implements SessionHandlerInterface - { - /** - * @var SessionHandler - */ - private $handler; - - public function __construct() - { - $this->handler = new SessionHandler(); - } - - public function close() - { - return $this->handler->close(); - } - - public function destroy($session_id) - { - return $this->handler->destroy($session_id); - } - - public function gc($maxlifetime) - { - return $this->handler->gc($maxlifetime); - } - - public function open($save_path, $name) - { - return $this->handler->open($save_path, $name); - } - - public function read($session_id) - { - return $this->handler->read($session_id); - } - - public function write($session_id, $session_data) - { - return $this->handler->write($session_id, $session_data); - } - } -} - -if ($sessionProxy) { - $handler = new TestHandler(); - session_set_save_handler($handler); -} - -session_id($sessionId); -if (!session_start()) { - $result = "FAILED: session_start()"; -} -elseif (!session_regenerate_id($destroyPrevious)) { - $result = "FAILED: session_regenerate_id()"; -} -else { - $result = session_id(); -} -session_write_close(); -echo $result; - diff --git a/startSession.php b/startSession.php deleted file mode 100644 index 2149da6..0000000 --- a/startSession.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php -error_reporting(E_ERROR | E_WARNING); - -$redisHost = $argv[1]; -$saveHandler = $argv[2]; -$sessionId = $argv[3]; -$sleepTime = $argv[4]; -$maxExecutionTime = $argv[5]; -$lock_retries = $argv[6]; -$lock_expire = $argv[7]; -$sessionData = $argv[8]; -$sessionLifetime = $argv[9]; - -if (empty($redisHost)) { - $redisHost = 'tcp://localhost:6379'; -} - -ini_set('session.save_handler', $saveHandler); -ini_set('session.save_path', $redisHost); -ini_set('max_execution_time', $maxExecutionTime); -ini_set('redis.session.lock_retries', $lock_retries); -ini_set('redis.session.lock_expire', $lock_expire); -ini_set('session.gc_maxlifetime', $sessionLifetime); - -if (isset($argv[8])) { - ini_set('redis.session.locking_enabled', $argv[10]); -} - -if (isset($argv[9])) { - ini_set('redis.session.lock_wait_time', $argv[11]); -} - -session_id($sessionId); -$sessionStartSuccessful = session_start(); -sleep($sleepTime); -if (!empty($sessionData)) { - $_SESSION['redis_test'] = $sessionData; -} -session_write_close(); - -echo $sessionStartSuccessful ? 'SUCCESS' : 'FAILURE';
\ No newline at end of file |