diff options
-rw-r--r-- | REFLECTION | 2 | ||||
-rw-r--r-- | env-pr2.patch | 87 | ||||
-rw-r--r-- | env-pr4.patch | 32 | ||||
-rw-r--r-- | php-pecl-env.spec | 13 |
4 files changed, 42 insertions, 92 deletions
@@ -1,4 +1,4 @@ -Extension [ <persistent> extension #90 env version 0.2.0 ] { +Extension [ <persistent> extension #90 env version 0.2.1 ] { - INI { Entry [ env.file <ALL> ] diff --git a/env-pr2.patch b/env-pr2.patch deleted file mode 100644 index fe754b7..0000000 --- a/env-pr2.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 7352239d4e1eeab5483b48366401a40a8d2e8764 Mon Sep 17 00:00:00 2001 -From: Remi Collet <fedora@famillecollet.com> -Date: Fri, 1 Jan 2016 19:44:43 +0100 -Subject: [PATCH 1/2] fix strange race condition (php 5.5, ZTS, i386) - ---- - php5/php_env.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/php5/php_env.c b/php5/php_env.c -index b98a3c7..91d62a1 100644 ---- a/php5/php_env.c -+++ b/php5/php_env.c -@@ -61,7 +61,13 @@ void php_env_request_init(HashTable *vars TSRMLS_DC) - type = zend_hash_get_current_key_ex(vars, &str, &len, &idx, 0, NULL); - if (type == HASH_KEY_IS_STRING) { - if ((zend_hash_get_current_data(vars, (void**)&data) == SUCCESS)) { -+ if (str[len]) { /* Workaroung php 5.5 / ZTS / i386 issue */ -+ char *tmp = estrndup(str, len); -+ setenv(tmp, *data, 1); -+ efree(tmp); -+ } else { - setenv(str, *data, 1); -+ } - } - } - } - -From 49372b5d4159c99d3fa15c78e1ffd6aa3c8def1c Mon Sep 17 00:00:00 2001 -From: Remi Collet <fedora@famillecollet.com> -Date: Fri, 1 Jan 2016 19:45:08 +0100 -Subject: [PATCH 2/2] use GINIT/GSHUTDOWN function - ---- - env.c | 17 +++++++++++------ - 1 file changed, 11 insertions(+), 6 deletions(-) - -diff --git a/env.c b/env.c -index c4d0bf7..3178e10 100644 ---- a/env.c -+++ b/env.c -@@ -50,18 +50,20 @@ void char_ptr_dtor(char **str) - #define char_ptr_dtor ZVAL_PTR_DTOR - #endif - --/* {{{ php_env_init_globals -+/* {{{ PHP_GINIT_FUNCTION - */ --static void php_env_init_globals(zend_env_globals *env_globals) -+PHP_GINIT_FUNCTION(env) - { - env_globals->file = NULL; - env_globals->parse_err = 0; - env_globals->vars = (HashTable*)pemalloc(sizeof(HashTable), 1); - zend_hash_init(env_globals->vars, 128, NULL, char_ptr_dtor, 1); - } -- - /* }}} */ --static void php_env_shutdown_globals(zend_env_globals *env_globals) -+ -+/* {{{ PHP_GSHUTDOWN_FUNCTION -+ */ -+PHP_GSHUTDOWN_FUNCTION(env) - { - env_globals->file = NULL; - env_globals->parse_err = 0; -@@ -72,7 +74,6 @@ static void php_env_shutdown_globals(zend_env_globals *env_globals) - */ - PHP_MINIT_FUNCTION(env) - { -- ZEND_INIT_MODULE_GLOBALS(env, php_env_init_globals, php_env_shutdown_globals); - REGISTER_INI_ENTRIES(); - - php_env_module_init(ENV_G(vars) TSRMLS_CC); -@@ -144,7 +145,11 @@ zend_module_entry env_module_entry = { - PHP_RSHUTDOWN(env), /* Replace with NULL if there's nothing to do at request end */ - PHP_MINFO(env), - PHP_ENV_VERSION, -- STANDARD_MODULE_PROPERTIES -+ PHP_MODULE_GLOBALS(env), /* globals descriptor */ -+ PHP_GINIT(env), /* globals ctor */ -+ PHP_GSHUTDOWN(env), /* globals dtor */ -+ NULL, /* post deactivate */ -+ STANDARD_MODULE_PROPERTIES_EX - }; - /* }}} */ - diff --git a/env-pr4.patch b/env-pr4.patch new file mode 100644 index 0000000..5cafd6a --- /dev/null +++ b/env-pr4.patch @@ -0,0 +1,32 @@ +From b12ee80b2198c8964b72790fe27b2754c7e86708 Mon Sep 17 00:00:00 2001 +From: Remi Collet <fedora@famillecollet.com> +Date: Sat, 2 Jan 2016 07:55:43 +0100 +Subject: [PATCH] fix PHP 7 dtor, fix #3 + +--- + env.c | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/env.c b/env.c +index 075139e..9263445 100644 +--- a/env.c ++++ b/env.c +@@ -41,18 +41,10 @@ PHP_INI_END() + /* }}} */ + + +-#if PHP_VERSION_ID < 70000 + void char_ptr_dtor(char **str) + { + free(*str); + } +-#else +-void char_ptr_dtor(zval **str) +-{ +- free(Z_STRVAL_PP(str)); +- free(*str); +-} +-#endif + + /* {{{ PHP_GINIT_FUNCTION + */ diff --git a/php-pecl-env.spec b/php-pecl-env.spec index 32aebde..a403008 100644 --- a/php-pecl-env.spec +++ b/php-pecl-env.spec @@ -19,7 +19,7 @@ %{!?__pecl: %global __pecl %{_bindir}/pecl} %{!?__php: %global __php %{_bindir}/php} -%global with_zts 0%{?__ztsphp:1} +%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global pecl_name env %if "%{php_version}" < "5.6" %global ini_name %{pecl_name}.ini @@ -29,7 +29,7 @@ Summary: Load environment variables Name: %{?sub_prefix}php-pecl-%{pecl_name} -Version: 0.2.0 +Version: 0.2.1 Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: MIT Group: Development/Languages @@ -37,7 +37,7 @@ URL: http://pecl.php.net/package/%{pecl_name} Source: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz -Patch0: %{pecl_name}-pr2.patch +Patch0: %{pecl_name}-pr4.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) # ignore min PHP version 5.5 (as work with 5.4) @@ -93,7 +93,7 @@ mv %{pecl_name}-%{version} NTS sed -e '/role="test"/d' -i package.xml cd NTS -%patch0 -p1 -b .pr2 +%patch0 -p1 -b .pr4 # Check upstream version (often broken) extver=$(sed -n '/#define PHP_ENV_VERSION/{s/.* "//;s/".*$//;p}' php_env.h) @@ -225,6 +225,11 @@ fi %changelog +* Sat Jan 02 2016 Remi Collet <remi@fedoraproject.org> - 0.2.1-1 +- Update to 0.2.1 (beta) +- fix broken PHP 7 build + open https://github.com/beberlei/env/pull/4 + * Fri Jan 01 2016 Remi Collet <remi@fedoraproject.org> - 0.2.0-1 - Update to 0.2.0 (beta) - fix strange php 5.5 / i386 / ZTS |