From 5584ee208e6a29014215abfceb204152b65a8f88 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 13 Nov 2018 09:05:16 +0100 Subject: update to 2.0.3 drop patch merged upstream --- 33.patch | 130 ----------------------------------------------------- PHPINFO | 14 ++++++ REFLECTION | 2 +- php-pecl-yaml.spec | 12 ++--- 4 files changed, 21 insertions(+), 137 deletions(-) delete mode 100644 33.patch create mode 100644 PHPINFO diff --git a/33.patch b/33.patch deleted file mode 100644 index 6e1f935..0000000 --- a/33.patch +++ /dev/null @@ -1,130 +0,0 @@ -From 4a3eb9f1c92e9dff6ce723bd94daef1580d080d2 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Wed, 4 Jul 2018 12:14:48 +0200 -Subject: [PATCH] Fix for PHP 7.3 - ---- - .gitignore | 2 ++ - .travis.yml | 3 +++ - emit.c | 53 ++++++++++++++++++++++++++++++++++++++++++----------- - 3 files changed, 47 insertions(+), 11 deletions(-) - -diff --git a/emit.c b/emit.c -index 993a666..fd3769e 100644 ---- a/emit.c -+++ b/emit.c -@@ -173,7 +173,11 @@ static void y_scan_recursion(const y_emit_state_t *state, zval *data TSRMLS_DC) - return; - } - -+#if PHP_VERSION_ID >= 70300 -+ if (!(GC_FLAGS(ht) & GC_IMMUTABLE) && GC_IS_RECURSIVE(ht)) { -+#else - if (ZEND_HASH_APPLY_PROTECTION(ht) && ht->u.v.nApplyCount > 0) { -+#endif - zval tmp; - ZVAL_LONG(&tmp, (zend_ulong) ht); - -@@ -182,17 +186,29 @@ static void y_scan_recursion(const y_emit_state_t *state, zval *data TSRMLS_DC) - return; - } - -+#if PHP_VERSION_ID >= 70300 -+ if (!(GC_FLAGS(ht) & GC_IMMUTABLE)) { -+ GC_PROTECT_RECURSION(ht); -+ } -+#else - if (ZEND_HASH_APPLY_PROTECTION(ht)) { - ht->u.v.nApplyCount++; - } -+#endif - - ZEND_HASH_FOREACH_VAL(ht, elm) { - y_scan_recursion(state, elm TSRMLS_CC); - } ZEND_HASH_FOREACH_END(); - -+#if PHP_VERSION_ID >= 70300 -+ if (!(GC_FLAGS(ht) & GC_IMMUTABLE)) { -+ GC_UNPROTECT_RECURSION(ht); -+ } -+#else - if (ZEND_HASH_APPLY_PROTECTION(ht)) { - ht->u.v.nApplyCount--; - } -+#endif - - return; - } -@@ -462,7 +478,6 @@ static int y_write_array( - zval key_zval; - zend_ulong kidx; - zend_string *kstr; -- HashTable *tmp_ht; - zend_long recursive_idx = -1; - char *anchor = { 0 }; - size_t anchor_size; -@@ -495,7 +510,11 @@ static int y_write_array( - anchor = (char*) emalloc(anchor_size + 1); - snprintf(anchor, anchor_size + 1, "refid%ld", recursive_idx + 1); - -- if (ZEND_HASH_APPLY_PROTECTION(ht) && ht->u.v.nApplyCount > 1) { -+#if PHP_VERSION_ID >= 70300 -+ if (!(GC_FLAGS(ht) & GC_IMMUTABLE) && GC_IS_RECURSIVE(ht)) { -+#else -+ if (ZEND_HASH_APPLY_PROTECTION(ht) && ht->u.v.nApplyCount > 0) { -+#endif - /* node has been visited before */ - status = yaml_alias_event_initialize( - &event, (yaml_char_t *) anchor); -@@ -536,6 +555,18 @@ static int y_write_array( - return FAILURE; - } - -+#if PHP_VERSION_ID >= 70300 -+ if (!(GC_FLAGS(ht) & GC_IMMUTABLE)) { -+ /* increment access count for hash */ -+ GC_PROTECT_RECURSION(ht); -+ } -+#else -+ if (ZEND_HASH_APPLY_PROTECTION(ht)) { -+ /* increment access count for hash */ -+ ht->u.v.nApplyCount++; -+ } -+#endif -+ - /* emit array elements */ - ZEND_HASH_FOREACH_KEY_VAL(ht, kidx, kstr, elm) { - ZVAL_DEREF(elm); -@@ -555,23 +586,23 @@ static int y_write_array( - } - } - -- tmp_ht = HASH_OF(elm); -- if (tmp_ht && ZEND_HASH_APPLY_PROTECTION(tmp_ht)) { -- /* increment access count for hash */ -- tmp_ht->u.v.nApplyCount++; -- } -- - status = y_write_zval(state, elm, NULL TSRMLS_CC); - -- if (tmp_ht && ZEND_HASH_APPLY_PROTECTION(tmp_ht)) { -- tmp_ht->u.v.nApplyCount--; -- } - - if (SUCCESS != status) { - return FAILURE; - } - } ZEND_HASH_FOREACH_END(); - -+#if PHP_VERSION_ID >= 70300 -+ if (!(GC_FLAGS(ht) & GC_IMMUTABLE)) { -+ GC_UNPROTECT_RECURSION(ht); -+ } -+#else -+ if (ZEND_HASH_APPLY_PROTECTION(ht)) { -+ ht->u.v.nApplyCount--; -+ } -+#endif - - if (Y_ARRAY_SEQUENCE == array_type) { - status = yaml_sequence_end_event_initialize(&event); diff --git a/PHPINFO b/PHPINFO new file mode 100644 index 0000000..59dd1f8 --- /dev/null +++ b/PHPINFO @@ -0,0 +1,14 @@ + +yaml + +LibYAML Support => enabled +Module Version => 2.0.3 +LibYAML Version => 0.2.1 + +Directive => Local Value => Master Value +yaml.decode_binary => 0 => 0 +yaml.decode_timestamp => 0 => 0 +yaml.decode_php => 0 => 0 +yaml.output_canonical => 0 => 0 +yaml.output_indent => 2 => 2 +yaml.output_width => 80 => 80 diff --git a/REFLECTION b/REFLECTION index 4f9d59d..9e5036a 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #162 yaml version 2.0.2 ] { +Extension [ extension #177 yaml version 2.0.3 ] { - Dependencies { Dependency [ date (Optional) ] diff --git a/php-pecl-yaml.spec b/php-pecl-yaml.spec index d51ecca..4cb869b 100644 --- a/php-pecl-yaml.spec +++ b/php-pecl-yaml.spec @@ -21,15 +21,13 @@ Summary: PHP Bindings for yaml Name: %{?sub_prefix}php-pecl-yaml -Version: 2.0.2 -Release: 5%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Version: 2.0.3 +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: MIT URL: http://pecl.php.net/package/yaml Source: http://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz -Patch0: https://patch-diff.githubusercontent.com/raw/php/pecl-file_formats-yaml/pull/33.patch - BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel >= 7 BuildRequires: %{?scl_prefix}php-pear @@ -94,8 +92,6 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS -%patch0 -p1 -b .pr33 - # Check upstream version (often broken) extver=$(sed -n '/#define PHP_YAML_VERSION/{s/.* "//;s/".*$//;p}' php_yaml.h) if test "x${extver}" != "x%{version}%{?prever}"; then @@ -243,6 +239,10 @@ fi %changelog +* Tue Nov 13 2018 Remi Collet - 2.0.3-1 +- update to 2.0.3 +- drop patch merged upstream + * Thu Aug 16 2018 Remi Collet - 2.0.2-5 - rebuild for 7.3.0beta2 new ABI -- cgit