diff options
author | Remi Collet <fedora@famillecollet.com> | 2016-01-15 14:31:34 +0100 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2016-01-15 14:31:34 +0100 |
commit | f7aac9aefcfc7e222c440f110629ee4c2925e727 (patch) | |
tree | 0137cae8867913d3d81ee99bb2dd4bbb0eb6d9d6 | |
parent | 690a21552b58a9967cfcec480c651973de3fcfd8 (diff) |
php-pecl-apcu: 5.1.3 (php 7, stable)
-rw-r--r-- | REFLECTION-PHP7 | 6 | ||||
-rw-r--r-- | apcu-upstream.patch | 227 | ||||
-rw-r--r-- | php-pecl-apcu-php7.spec | 15 |
3 files changed, 8 insertions, 240 deletions
diff --git a/REFLECTION-PHP7 b/REFLECTION-PHP7 index 91fafcd..c0433f7 100644 --- a/REFLECTION-PHP7 +++ b/REFLECTION-PHP7 @@ -1,4 +1,4 @@ -Extension [ <persistent> extension #56 apcu version 5.1.2 ] { +Extension [ <persistent> extension #56 apcu version 5.1.3 ] { - INI { Entry [ apc.enabled <SYSTEM> ] @@ -23,7 +23,7 @@ Extension [ <persistent> extension #56 apcu version 5.1.2 ] { Current = '0' } Entry [ apc.mmap_file_mask <SYSTEM> ] - Current = '/tmp/apc.FeiOLJ' + Current = '/tmp/apc.0iU40E' } Entry [ apc.enable_cli <SYSTEM> ] Current = '1' @@ -49,7 +49,7 @@ Extension [ <persistent> extension #56 apcu version 5.1.2 ] { } - Constants [16] { - Constant [ integer ] { 140593052737952 } + Constant [ integer ] { 140446566924704 } Constant [ integer APC_LIST_ACTIVE ] { 1 } Constant [ integer APC_LIST_DELETED ] { 2 } Constant [ integer APC_ITER_TYPE ] { 1 } diff --git a/apcu-upstream.patch b/apcu-upstream.patch deleted file mode 100644 index b21aeb6..0000000 --- a/apcu-upstream.patch +++ /dev/null @@ -1,227 +0,0 @@ -diff --git a/apc_globals.h b/apc_globals.h -index 40509f0..a0de234 100644 ---- a/apc_globals.h -+++ b/apc_globals.h -@@ -41,12 +41,12 @@ - ZEND_BEGIN_MODULE_GLOBALS(apcu) - /* configuration parameters */ - zend_bool enabled; /* if true, apc is enabled (defaults to true) */ -- long shm_segments; /* number of shared memory segments to use */ -- long shm_size; /* size of each shared memory segment (in MB) */ -- long entries_hint; /* hint at the number of entries expected */ -- long gc_ttl; /* parameter to apc_cache_create */ -- long ttl; /* parameter to apc_cache_create */ -- long smart; /* smart value */ -+ zend_long shm_segments; /* number of shared memory segments to use */ -+ zend_long shm_size; /* size of each shared memory segment (in MB) */ -+ zend_long entries_hint; /* hint at the number of entries expected */ -+ zend_long gc_ttl; /* parameter to apc_cache_create */ -+ zend_long ttl; /* parameter to apc_cache_create */ -+ zend_long smart; /* smart value */ - - #if APC_MMAP - char *mmap_file_mask; /* mktemp-style file-mask to pass to mmap */ -diff --git a/php_apc.c b/php_apc.c -index c35ede1..83fd758 100644 ---- a/php_apc.c -+++ b/php_apc.c -@@ -118,11 +118,11 @@ static PHP_INI_MH(OnUpdateShmSize) /* {{{ */ - return FAILURE; - } - -- if (s < 1048576L) { -+ if (s < Z_L(1048576)) { - /* if it's less than 1Mb, they are probably using the old syntax */ - php_error_docref( - NULL, E_WARNING, "apc.shm_size now uses M/G suffixes, please update your ini files"); -- s = s * 1048576L; -+ s = s * Z_L(1048576); - } - - APCG(shm_size) = s; -@@ -526,60 +526,46 @@ PHP_FUNCTION(apcu_add) { - /* {{{ php_inc_updater */ - - struct php_inc_updater_args { -- zend_long step; -- zend_long lval; -+ zval step; -+ zval rval; - }; - - static zend_bool php_inc_updater(apc_cache_t* cache, apc_cache_entry_t* entry, void* data) { - struct php_inc_updater_args *args = (struct php_inc_updater_args*) data; - - if (Z_TYPE(entry->val) == IS_LONG) { -- while (args->step--) { -- fast_long_increment_function(&entry->val); -- } -- args->lval = Z_LVAL(entry->val); -+ fast_long_add_function(&entry->val, &entry->val, &args->step); -+ ZVAL_COPY_VALUE(&args->rval, &entry->val); - return 1; - } - - return 0; - } - --static zend_bool php_dec_updater(apc_cache_t* cache, apc_cache_entry_t* entry, void* data) { -- struct php_inc_updater_args *args = (struct php_inc_updater_args*) data; -- -- if (Z_TYPE(entry->val) == IS_LONG) { -- while (args->step--) { -- fast_long_decrement_function(&entry->val); -- } -- args->lval = Z_LVAL(entry->val); -- return 1; -- } -- -- return 0; --} --/* }}} */ -- - /* {{{ proto long apc_inc(string key [, long step [, bool& success]]) - */ - PHP_FUNCTION(apcu_inc) { - zend_string *key; -- struct php_inc_updater_args args = {1L, -1}; -+ struct php_inc_updater_args args; -+ zend_long step = 1; - zval *success = NULL; - -- if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|lz", &key, &(args.step), &success) == FAILURE) { -+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|lz", &key, &step, &success) == FAILURE) { - return; - } -- -+ - if (success) { - ZVAL_DEREF(success); - zval_ptr_dtor(success); - } - -+ ZVAL_LONG(&args.step, step); -+ - if (php_apc_update(key, php_inc_updater, &args)) { - if (success) { - ZVAL_TRUE(success); - } -- RETURN_LONG(args.lval); -+ RETURN_ZVAL(&args.rval, 0, 0); - } - - if (success) { -@@ -594,24 +580,27 @@ PHP_FUNCTION(apcu_inc) { - */ - PHP_FUNCTION(apcu_dec) { - zend_string *key; -- struct php_inc_updater_args args = {1L, -1}; -+ struct php_inc_updater_args args; -+ zend_long step = 1; - zval *success = NULL; - -- if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|lz", &key, &(args.step), &success) == FAILURE) { -+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|lz", &key, &step, &success) == FAILURE) { - return; - } -- -+ - if (success) { - ZVAL_DEREF(success); - zval_ptr_dtor(success); - } - -- if (php_apc_update(key, php_dec_updater, &args)) { -+ ZVAL_LONG(&args.step, 0 - step); -+ -+ if (php_apc_update(key, php_inc_updater, &args)) { - if (success) { - ZVAL_TRUE(success); - } - -- RETURN_LONG(args.lval); -+ RETURN_ZVAL(&args.rval, 0, 0); - } - - if (success) { -@@ -662,9 +651,7 @@ PHP_FUNCTION(apcu_cas) { - PHP_FUNCTION(apcu_fetch) { - zval *key; - zval *success = NULL; -- apc_cache_entry_t* entry; - time_t t; -- apc_context_t ctxt = {0,}; - - if (!APCG(enabled)) { - RETURN_FALSE; -diff --git a/tests/apc_012.phpt b/tests/apc_012.phpt -index e7844ef..0d3b050 100644 ---- a/tests/apc_012.phpt -+++ b/tests/apc_012.phpt -@@ -10,25 +10,28 @@ apc.enable_cli=1 - $key="testkey"; - $i=PHP_INT_MAX; - apcu_store($key, $i); --$j=apcu_fetch($key); -+var_dump($j=apcu_fetch($key)); - var_dump($i==$j); - - apcu_inc($key, 1); - $i++; --$j=apcu_fetch($key); -+var_dump($j=apcu_fetch($key)); - var_dump($i==$j); - - $i=PHP_INT_MIN; - apcu_store($key, $i); - apcu_dec($key, 1); - $i--; --$j=apcu_fetch($key); -+var_dump($j=apcu_fetch($key)); - var_dump($i==$j); - ?> - ===DONE=== - <?php exit(0); ?> ----EXPECT-- -+--EXPECTF-- -+int(%d) - bool(true) -+float(%s) - bool(true) -+float(%s) - bool(true) - ===DONE=== -diff --git a/tests/apc_inc_perf.phpt b/tests/apc_inc_perf.phpt -new file mode 100644 -index 0000000..8f082f1 ---- /dev/null -+++ b/tests/apc_inc_perf.phpt -@@ -0,0 +1,28 @@ -+--TEST-- -+APC: apcu_inc/apcu_dec performance test (gh#164) -+--SKIPIF-- -+<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> -+--INI-- -+apc.enabled=1 -+apc.enable_cli=1 -+apc.file_update_protection=0 -+--FILE-- -+<?php -+apcu_store('foobar', 1); -+$t = microtime(true); -+var_dump(apcu_inc('foobar', 0x76543210)); -+var_dump(apcu_dec('foobar', 0x76543210)); -+var_dump(apcu_dec('foobar', -999999999)); -+var_dump(apcu_inc('foobar', -999999999)); -+$t = microtime(true) - $t; -+var_dump($t < 0.1 ? true : $t); -+?> -+===DONE=== -+<?php exit(0); ?> -+--EXPECTF-- -+int(1985229329) -+int(1) -+int(1000000000) -+int(1) -+bool(true) -+===DONE=== diff --git a/php-pecl-apcu-php7.spec b/php-pecl-apcu-php7.spec index 0a9b2ab..8edd32b 100644 --- a/php-pecl-apcu-php7.spec +++ b/php-pecl-apcu-php7.spec @@ -10,12 +10,8 @@ # Please, preserve the changelog entries # %if 0%{?scl:1} -%if "%{scl}" == "rh-php56" -%global sub_prefix more-php56- -%else %global sub_prefix %{scl_prefix} %endif -%endif %{?scl: %scl_package php-pecl-apcu} %{!?scl: %global pkg_name %{name}} @@ -36,21 +32,18 @@ Name: %{?sub_prefix}php-pecl-apcu Summary: APC User Cache -Version: 5.1.2 +Version: 5.1.3 %if 0%{?gh_date:1} Release: 0.2.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz %else -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}-%{version}.tgz %endif Source1: %{pecl_name}-5.1.2.ini Source2: %{pecl_name}-panel.conf Source3: %{pecl_name}.conf.php -# Patch from master, for apcu_in / apcu_dec issues -Patch1: %{pecl_name}-upstream.patch - License: PHP Group: Development/Languages URL: http://pecl.php.net/package/APCu @@ -157,7 +150,6 @@ mv %{pecl_name}-%{version} NTS %endif cd NTS -%patch1 -p1 -b .upstream # Sanity check, really often broken extver=$(sed -n '/#define PHP_APCU_VERSION/{s/.* "//;s/".*$//;p}' php_apc.h) @@ -326,6 +318,9 @@ fi %changelog +* Fri Jan 15 2016 Remi Collet <remi@fedoraproject.org> - 5.1.3-1 +- Update to 5.1.3 (stable) + * Sat Jan 9 2016 Remi Collet <remi@fedoraproject.org> - 5.1.2-2 - add upstream patches to fix issues with apcu_inc / apcu_dec https://github.com/krakjoe/apcu/issues/158 - negative step hangs |