summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-06-28 17:05:18 +0200
committerRemi Collet <remi@remirepo.net>2017-06-28 17:05:18 +0200
commitebbb429ab9b07b73cc34b6b302eaeab87231f1d2 (patch)
tree8fca9008065e5afd2315ab312da89638083f279b
parent0616b55bdb352b9538c14845016700279a454508 (diff)
add patch for PHP 7.2
-rw-r--r--.gitignore7
-rw-r--r--01a154bc126333e03f2c98117e79059553760001.patch832
-rw-r--r--20.patch107
-rw-r--r--php-pecl-ref.spec16
4 files changed, 961 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..1ab5c4f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+package-*.xml
+*.tgz
+*.tar.gz
+*.tar.xz
+*.tar.xz.asc
+*.src.rpm
+*/*rpm
diff --git a/01a154bc126333e03f2c98117e79059553760001.patch b/01a154bc126333e03f2c98117e79059553760001.patch
new file mode 100644
index 0000000..c1da0e7
--- /dev/null
+++ b/01a154bc126333e03f2c98117e79059553760001.patch
@@ -0,0 +1,832 @@
+From 01a154bc126333e03f2c98117e79059553760001 Mon Sep 17 00:00:00 2001
+From: Bogdan Padalko <pinepain@gmail.com>
+Date: Thu, 2 Feb 2017 23:12:00 +0200
+Subject: [PATCH] Remove vim markup
+
+---
+ php_ref.h | 10 ---
+ php_ref_functions.c | 52 ++++++---------
+ php_ref_functions.h | 10 ---
+ php_ref_notifier_exception.c | 32 ++++-----
+ php_ref_notifier_exception.h | 10 ---
+ php_ref_reference.c | 154 ++++++++++++++++++++-----------------------
+ php_ref_reference.h | 10 ---
+ ref.c | 37 ++++-------
+ 8 files changed, 118 insertions(+), 197 deletions(-)
+
+diff --git a/php_ref.h b/php_ref.h
+index ad8eb34..bbbc4cc 100644
+--- a/php_ref.h
++++ b/php_ref.h
+@@ -57,13 +57,3 @@ ZEND_TSRMLS_CACHE_EXTERN();
+ #endif
+
+ #endif /* PHP_REF_H */
+-
+-
+-/*
+- * Local variables:
+- * tab-width: 4
+- * c-basic-offset: 4
+- * End:
+- * vim600: noet sw=4 ts=4 fdm=marker
+- * vim<600: noet sw=4 ts=4
+- */
+diff --git a/php_ref_functions.c b/php_ref_functions.c
+index e194484..aa03a91 100644
+--- a/php_ref_functions.c
++++ b/php_ref_functions.c
+@@ -14,7 +14,7 @@
+ #include "php_ref_reference.h"
+ #include "php_ref.h"
+
+-PHP_FUNCTION(refcounted) /* {{{ */
++PHP_FUNCTION(refcounted)
+ {
+ zval *zv;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zv) == FAILURE) {
+@@ -22,7 +22,7 @@ PHP_FUNCTION(refcounted) /* {{{ */
+ }
+
+ RETURN_BOOL(Z_REFCOUNTED_P(zv));
+-} /* }}} */
++}
+
+ PHP_FUNCTION(refcount)
+ {
+@@ -37,9 +37,9 @@ PHP_FUNCTION(refcount)
+ }
+
+ RETURN_LONG(0);
+-} /* }}} */
++}
+
+-PHP_FUNCTION(softrefcounted) /* {{{ */
++PHP_FUNCTION(softrefcounted)
+ {
+ zval *zv;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zv) == FAILURE) {
+@@ -53,9 +53,9 @@ PHP_FUNCTION(softrefcounted) /* {{{ */
+ }
+
+ RETURN_BOOL(0);
+-} /* }}} */
++}
+
+-PHP_FUNCTION(softrefcount) /* {{{ */
++PHP_FUNCTION(softrefcount)
+ {
+ zval *zv;
+
+@@ -75,9 +75,9 @@ PHP_FUNCTION(softrefcount) /* {{{ */
+ }
+
+ RETURN_LONG(0);
+-} /* }}} */
++}
+
+-PHP_FUNCTION(softrefs) /* {{{ */
++PHP_FUNCTION(softrefs)
+ {
+ zval *zv;
+ zval softrefs;
+@@ -108,9 +108,9 @@ PHP_FUNCTION(softrefs) /* {{{ */
+ }
+
+ RETURN_ZVAL(&softrefs, 1, 1);
+-} /* }}} */
++}
+
+-PHP_FUNCTION(weakrefcounted) /* {{{ */
++PHP_FUNCTION(weakrefcounted)
+ {
+ zval *zv;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zv) == FAILURE) {
+@@ -124,9 +124,9 @@ PHP_FUNCTION(weakrefcounted) /* {{{ */
+ }
+
+ RETURN_BOOL(0);
+-} /* }}} */
++}
+
+-PHP_FUNCTION(weakrefcount) /* {{{ */
++PHP_FUNCTION(weakrefcount)
+ {
+ zval *zv;
+
+@@ -146,9 +146,9 @@ PHP_FUNCTION(weakrefcount) /* {{{ */
+ }
+
+ RETURN_LONG(0);
+-} /* }}} */
++}
+
+-PHP_FUNCTION(weakrefs) /* {{{ */
++PHP_FUNCTION(weakrefs)
+ {
+ zval *zv;
+ zval weakrefs;
+@@ -179,9 +179,9 @@ PHP_FUNCTION(weakrefs) /* {{{ */
+ }
+
+ RETURN_ZVAL(&weakrefs, 1, 1);
+-} /* }}} */
++}
+
+-PHP_FUNCTION(object_handle) /* {{{ */
++PHP_FUNCTION(object_handle)
+ {
+ zval *zv;
+
+@@ -190,9 +190,9 @@ PHP_FUNCTION(object_handle) /* {{{ */
+ }
+
+ RETURN_LONG((uint32_t)Z_OBJ_HANDLE_P(zv));
+-} /* }}} */
++}
+
+-PHP_FUNCTION(is_obj_destructor_called) /* {{{ */
++PHP_FUNCTION(is_obj_destructor_called)
+ {
+ zval *zv;
+
+@@ -205,7 +205,7 @@ PHP_FUNCTION(is_obj_destructor_called) /* {{{ */
+ uint32_t flags = GC_FLAGS(obj);
+
+ RETURN_BOOL(flags & IS_OBJ_DESTRUCTOR_CALLED);
+-} /* }}} */
++}
+
+
+ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(refcounted_arg, ZEND_RETURN_VALUE, 1, _IS_BOOL, NULL, 0)
+@@ -248,7 +248,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(is_obj_destructor_called_arg, ZEND_RETUR
+ ZEND_ARG_INFO(0, object)
+ ZEND_END_ARG_INFO()
+
+-const zend_function_entry php_ref_functions[] = { /* {{{ */
++const zend_function_entry php_ref_functions[] = {
+ ZEND_NS_FE(PHP_REF_NS, refcounted, refcounted_arg)
+ ZEND_NS_FE(PHP_REF_NS, refcount, refcount_arg)
+
+@@ -264,14 +264,4 @@ const zend_function_entry php_ref_functions[] = { /* {{{ */
+ ZEND_NS_FE(PHP_REF_NS, is_obj_destructor_called, is_obj_destructor_called_arg)
+
+ PHP_FE_END
+-}; /* }}} */
+-
+-
+-/*
+- * Local variables:
+- * tab-width: 4
+- * c-basic-offset: 4
+- * End:
+- * vim600: noet sw=4 ts=4 fdm=marker
+- * vim<600: noet sw=4 ts=4
+- */
++};
+diff --git a/php_ref_functions.h b/php_ref_functions.h
+index 945180d..e8d80f5 100644
+--- a/php_ref_functions.h
++++ b/php_ref_functions.h
+@@ -22,13 +22,3 @@
+ extern const zend_function_entry php_ref_functions[];
+
+ #endif /* PHP_REF_FUNCTIONS_H */
+-
+-
+-/*
+- * Local variables:
+- * tab-width: 4
+- * c-basic-offset: 4
+- * End:
+- * vim600: noet sw=4 ts=4 fdm=marker
+- * vim<600: noet sw=4 ts=4
+- */
+diff --git a/php_ref_notifier_exception.c b/php_ref_notifier_exception.c
+index d3aaa0f..65b3e73 100644
+--- a/php_ref_notifier_exception.c
++++ b/php_ref_notifier_exception.c
+@@ -19,7 +19,7 @@ zend_class_entry *php_ref_notifier_exception_class_entry;
+ #define this_ce php_ref_notifier_exception_class_entry
+
+
+-static zend_object *php_ref_notifier_exception_ctor(zend_class_entry *ce) /* {{{ */
++static zend_object *php_ref_notifier_exception_ctor(zend_class_entry *ce)
+ {
+ zval obj, thrown;
+ zend_object *object;
+@@ -30,17 +30,17 @@ static zend_object *php_ref_notifier_exception_ctor(zend_class_entry *ce) /* {{{
+ zend_update_property(php_ref_notifier_exception_class_entry, &obj, ZEND_STRL("exceptions"), &thrown);
+
+ return object;
+-} /* }}} */
++}
+
+
+-void php_ref_create_notifier_exception(zval *exception, const char *message, zval *thrown) /* {{{ */
++void php_ref_create_notifier_exception(zval *exception, const char *message, zval *thrown)
+ {
+ object_init_ex(exception, this_ce);
+ zend_update_property_string(zend_ce_exception, exception, ZEND_STRL("message"), message);
+ zend_update_property(php_ref_notifier_exception_class_entry, exception, ZEND_STRL("exceptions"), thrown);
+-} /* }}} */
++}
+
+-static PHP_METHOD(NotifierException, __construct) /* {{{ */
++static PHP_METHOD(NotifierException, __construct)
+ {
+ zend_string *message = NULL;
+ zend_long code = 0;
+@@ -73,7 +73,7 @@ static PHP_METHOD(NotifierException, __construct) /* {{{ */
+ }
+ }
+
+-static PHP_METHOD(NotifierException, getExceptions) /* {{{ */
++static PHP_METHOD(NotifierException, getExceptions)
+ {
+ zval rv;
+
+@@ -82,7 +82,7 @@ static PHP_METHOD(NotifierException, getExceptions) /* {{{ */
+ }
+
+ RETVAL_ZVAL(zend_read_property(php_ref_notifier_exception_class_entry, getThis(), ZEND_STRL("exceptions"), 0, &rv), 1, 0);
+-} /* }}} */
++}
+
+
+ ZEND_BEGIN_ARG_INFO_EX(arginfo_notifier_exception___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0)
+@@ -96,15 +96,15 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_notifier_exception_getExceptions, ZEND_SEND_BY_VA
+ ZEND_END_ARG_INFO()
+
+
+-static const zend_function_entry php_ref_notifier_exception_methods[] = { /* {{{ */
++static const zend_function_entry php_ref_notifier_exception_methods[] = {
+ PHP_ME(NotifierException, __construct, arginfo_notifier_exception___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
+ PHP_ME(NotifierException, getExceptions, arginfo_notifier_exception_getExceptions, ZEND_ACC_PUBLIC)
+
+ PHP_FE_END
+-}; /* }}} */
++};
+
+
+-PHP_MINIT_FUNCTION (php_ref_notifier_exception) /* {{{ */
++PHP_MINIT_FUNCTION (php_ref_notifier_exception)
+ {
+ zend_class_entry ce;
+
+@@ -116,14 +116,4 @@ PHP_MINIT_FUNCTION (php_ref_notifier_exception) /* {{{ */
+
+
+ return SUCCESS;
+-} /* }}} */
+-
+-
+-/*
+- * Local variables:
+- * tab-width: 4
+- * c-basic-offset: 4
+- * End:
+- * vim600: noet sw=4 ts=4 fdm=marker
+- * vim<600: noet sw=4 ts=4
+- */
++}
+diff --git a/php_ref_notifier_exception.h b/php_ref_notifier_exception.h
+index ac99180..7374d4b 100644
+--- a/php_ref_notifier_exception.h
++++ b/php_ref_notifier_exception.h
+@@ -27,13 +27,3 @@ PHP_MINIT_FUNCTION(php_ref_notifier_exception);
+
+
+ #endif /* PHP_REF_NOTIFIER_EXCEPTION_H */
+-
+-
+-/*
+- * Local variables:
+- * tab-width: 4
+- * c-basic-offset: 4
+- * End:
+- * vim600: noet sw=4 ts=4 fdm=marker
+- * vim<600: noet sw=4 ts=4
+- */
+diff --git a/php_ref_reference.c b/php_ref_reference.c
+index fa0e0fe..8c643bc 100644
+--- a/php_ref_reference.c
++++ b/php_ref_reference.c
+@@ -30,21 +30,21 @@ static inline void php_ref_store_exceptions(zval *exceptions, zval *tmp);
+ static int php_ref_reference_check_notifier(zval *notifier, zval *this);
+
+
+-php_ref_reference_t *php_ref_reference_fetch_object(zend_object *obj) /* {{{ */
++php_ref_reference_t *php_ref_reference_fetch_object(zend_object *obj)
+ {
+ return (php_ref_reference_t *) ((char *) obj - XtOffsetOf(php_ref_reference_t, std));
+-} /* }}} */
++}
+
+-php_ref_referent_t *php_ref_referent_find_ptr(zend_ulong h) /* {{{ */
++php_ref_referent_t *php_ref_referent_find_ptr(zend_ulong h)
+ {
+ if (NULL == PHP_REF_G(referents)) {
+ return NULL;
+ }
+
+ return (php_ref_referent_t *) zend_hash_index_find_ptr(PHP_REF_G(referents), h);
+-} /* }}} */
++}
+
+-void php_ref_reference_call_notifier(zval *reference, zval *notifier) /* {{{ */
++void php_ref_reference_call_notifier(zval *reference, zval *notifier)
+ {
+ zval args;
+ zval retval_tmp;
+@@ -86,9 +86,9 @@ void php_ref_reference_call_notifier(zval *reference, zval *notifier) /* {{{ */
+ zval_ptr_dtor(&args);
+ zval_ptr_dtor(&retval_tmp);
+
+-} /* }}} */
++}
+
+-static void php_ref_nullify_referents(HashTable *references) /* {{{ */
++static void php_ref_nullify_referents(HashTable *references)
+ {
+ zend_ulong handle;
+ php_ref_reference_t *reference;
+@@ -99,9 +99,9 @@ static void php_ref_nullify_referents(HashTable *references) /* {{{ */
+
+ zend_hash_index_del(references, handle);
+ } ZEND_HASH_FOREACH_END();
+-} /* }}} */
++}
+
+-static void php_ref_call_notifiers(HashTable *references, zval *exceptions, zval *tmp, zend_bool after_dtor) /* {{{ */
++static void php_ref_call_notifiers(HashTable *references, zval *exceptions, zval *tmp, zend_bool after_dtor)
+ {
+ zend_ulong handle;
+ php_ref_reference_t *reference;
+@@ -140,9 +140,9 @@ static void php_ref_call_notifiers(HashTable *references, zval *exceptions, zval
+ }
+ } ZEND_HASH_FOREACH_END();
+
+-} /* }}} */
++}
+
+-void php_ref_referent_object_dtor_obj(zend_object *object) /* {{{ */
++void php_ref_referent_object_dtor_obj(zend_object *object)
+ {
+ php_ref_referent_t *referent = php_ref_referent_find_ptr(object->handle);
+
+@@ -193,9 +193,9 @@ void php_ref_referent_object_dtor_obj(zend_object *object) /* {{{ */
+
+ zend_throw_exception_object(&exception);
+ }
+-} /* }}} */
++}
+
+-void php_ref_globals_referents_ht_dtor(zval *zv) /* {{{ */
++void php_ref_globals_referents_ht_dtor(zval *zv)
+ {
+ php_ref_referent_t *referent = (php_ref_referent_t *) Z_PTR_P(zv);
+
+@@ -207,17 +207,17 @@ void php_ref_globals_referents_ht_dtor(zval *zv) /* {{{ */
+ Z_OBJ(referent->this_ptr)->handlers = referent->original_handlers;
+
+ efree(referent);
+-} /* }}} */
++}
+
+-void php_ref_referent_weak_references_ht_dtor(zval *zv) /* {{{ */
++void php_ref_referent_weak_references_ht_dtor(zval *zv)
+ {
+ php_ref_reference_t *reference = (php_ref_reference_t *) Z_PTR_P(zv);
+
+ /* clean links to ht & release callbacks as we don't need them already*/
+ reference->referent = NULL; /* no need to free anything at this point here */
+-} /* }}} */
++}
+
+-php_ref_referent_t *php_ref_referent_get_or_create(zval *referent_zv) /* {{{ */
++php_ref_referent_t *php_ref_referent_get_or_create(zval *referent_zv)
+ {
+ php_ref_referent_t *referent = php_ref_referent_find_ptr((zend_ulong) Z_OBJ_HANDLE_P(referent_zv));
+
+@@ -248,57 +248,57 @@ php_ref_referent_t *php_ref_referent_get_or_create(zval *referent_zv) /* {{{ */
+ zend_hash_index_add_ptr(PHP_REF_G(referents), (zend_ulong) Z_OBJ_HANDLE_P(referent_zv), referent);
+
+ return referent;
+-} /* }}} */
++}
+
+-void php_ref_abstract_reference_attach(php_ref_reference_t *reference, php_ref_referent_t *referent) /* {{{ */
++void php_ref_abstract_reference_attach(php_ref_reference_t *reference, php_ref_referent_t *referent)
+ {
+-} /* }}} */
++}
+
+-void php_ref_abstract_reference_maybe_unregister(php_ref_reference_t *reference) /* {{{ */
++void php_ref_abstract_reference_maybe_unregister(php_ref_reference_t *reference)
+ {
+-} /* }}} */
++}
+
+-void php_ref_soft_reference_attach(php_ref_reference_t *reference, php_ref_referent_t *referent) /* {{{ */
++void php_ref_soft_reference_attach(php_ref_reference_t *reference, php_ref_referent_t *referent)
+ {
+ reference->referent = referent;
+ zend_hash_index_add_ptr(&referent->soft_references, (zend_ulong) Z_OBJ_HANDLE_P(&reference->this_ptr), reference);
+-} /* }}} */
++}
+
+-void php_ref_soft_reference_unregister(php_ref_reference_t *reference) /* {{{ */
++void php_ref_soft_reference_unregister(php_ref_reference_t *reference)
+ {
+ zend_hash_index_del(&reference->referent->soft_references, (zend_ulong) Z_OBJ_HANDLE_P(&reference->this_ptr));
+-} /* }}} */
++}
+
+-void php_ref_soft_reference_maybe_unregister(php_ref_reference_t *reference) /* {{{ */
++void php_ref_soft_reference_maybe_unregister(php_ref_reference_t *reference)
+ {
+ if (NULL == reference->referent) {
+ return;
+ }
+
+ php_ref_soft_reference_unregister(reference);
+-} /* }}} */
++}
+
+-void php_ref_reference_attach(php_ref_reference_t *reference, php_ref_referent_t *referent) /* {{{ */
++void php_ref_reference_attach(php_ref_reference_t *reference, php_ref_referent_t *referent)
+ {
+ reference->referent = referent;
+ zend_hash_index_add_ptr(&referent->weak_references, (zend_ulong) Z_OBJ_HANDLE_P(&reference->this_ptr), reference);
+-} /* }}} */
++}
+
+-void php_ref_reference_unregister(php_ref_reference_t *reference) /* {{{ */
++void php_ref_reference_unregister(php_ref_reference_t *reference)
+ {
+ zend_hash_index_del(&reference->referent->weak_references, (zend_ulong) Z_OBJ_HANDLE_P(&reference->this_ptr));
+-} /* }}} */
++}
+
+-void php_ref_reference_maybe_unregister(php_ref_reference_t *reference) /* {{{ */
++void php_ref_reference_maybe_unregister(php_ref_reference_t *reference)
+ {
+ if (NULL == reference->referent) {
+ return;
+ }
+
+ php_ref_reference_unregister(reference);
+-} /* }}} */
++}
+
+-php_ref_reference_t *php_ref_reference_init(zval *this_ptr, zval *referent_zv, zval *notifier_zv) /* {{{ */
++php_ref_reference_t *php_ref_reference_init(zval *this_ptr, zval *referent_zv, zval *notifier_zv)
+ {
+ php_ref_referent_t *referent;
+
+@@ -325,7 +325,7 @@ php_ref_reference_t *php_ref_reference_init(zval *this_ptr, zval *referent_zv, z
+ reference->notifier_type = notifier_type;
+
+ return reference;
+-} /* }}} */
++}
+
+ static inline void php_ref_store_exceptions(zval *exceptions, zval *tmp)
+ {
+@@ -340,7 +340,7 @@ static inline void php_ref_store_exceptions(zval *exceptions, zval *tmp)
+ zend_clear_exception();
+ }
+
+-static int php_ref_reference_check_notifier(zval *notifier, zval *this) /* {{{ */
++static int php_ref_reference_check_notifier(zval *notifier, zval *this)
+ {
+ if (NULL == notifier) {
+ /* no value provided at all, nothing to check */
+@@ -368,9 +368,9 @@ static int php_ref_reference_check_notifier(zval *notifier, zval *this) /* {{{ *
+ }
+
+ return PHP_REF_NOTIFIER_CALLBACK;
+-} /* }}} */
++}
+
+-static HashTable *php_ref_reference_gc(zval *object, zval **table, int *n) /* {{{ */
++static HashTable *php_ref_reference_gc(zval *object, zval **table, int *n)
+ {
+ PHP_REF_REFERENCE_FETCH_INTO(object, reference);
+
+@@ -378,9 +378,9 @@ static HashTable *php_ref_reference_gc(zval *object, zval **table, int *n) /* {{
+ *n = 1;
+
+ return zend_std_get_properties(object);
+-} /* }}} */
++}
+
+-static void php_ref_reference_free(zend_object *object) /* {{{ */
++static void php_ref_reference_free(zend_object *object)
+ {
+ php_ref_reference_t *reference = php_ref_reference_fetch_object(object);
+
+@@ -394,9 +394,9 @@ static void php_ref_reference_free(zend_object *object) /* {{{ */
+
+ /* freeing original object */
+ zend_object_std_dtor(&reference->std);
+-} /* }}} */
++}
+
+-static void php_ref_reference_dtor(zend_object *object) /* {{{ */
++static void php_ref_reference_dtor(zend_object *object)
+ {
+ php_ref_reference_t *reference = php_ref_reference_fetch_object(object);
+
+@@ -410,9 +410,9 @@ static void php_ref_reference_dtor(zend_object *object) /* {{{ */
+
+ /* call standard dtor */
+ zend_objects_destroy_object(object);
+-} /* }}} */
++}
+
+-static zend_object *php_ref_abstract_reference_ctor(zend_class_entry *ce) /* {{{ */
++static zend_object *php_ref_abstract_reference_ctor(zend_class_entry *ce)
+ {
+ php_ref_reference_t *reference;
+
+@@ -427,9 +427,9 @@ static zend_object *php_ref_abstract_reference_ctor(zend_class_entry *ce) /* {{
+ reference->unregister_reference = php_ref_abstract_reference_maybe_unregister;
+
+ return &reference->std;
+-} /* }}} */
++}
+
+-static zend_object *php_ref_soft_reference_ctor(zend_class_entry *ce) /* {{{ */
++static zend_object *php_ref_soft_reference_ctor(zend_class_entry *ce)
+ {
+ php_ref_reference_t *reference;
+
+@@ -444,9 +444,9 @@ static zend_object *php_ref_soft_reference_ctor(zend_class_entry *ce) /* {{{ */
+ reference->unregister_reference = php_ref_soft_reference_maybe_unregister;
+
+ return &reference->std;
+-} /* }}} */
++}
+
+-static zend_object *php_ref_weak_reference_ctor(zend_class_entry *ce) /* {{{ */
++static zend_object *php_ref_weak_reference_ctor(zend_class_entry *ce)
+ {
+ php_ref_reference_t *reference;
+
+@@ -461,9 +461,9 @@ static zend_object *php_ref_weak_reference_ctor(zend_class_entry *ce) /* {{{ */
+ reference->unregister_reference = php_ref_reference_maybe_unregister;
+
+ return &reference->std;
+-} /* }}} */
++}
+
+-static zend_object *php_ref_reference_clone_obj(zval *object) /* {{{ */
++static zend_object *php_ref_reference_clone_obj(zval *object)
+ {
+ zend_object *old_object;
+ zend_object *new_object;
+@@ -486,9 +486,9 @@ static zend_object *php_ref_reference_clone_obj(zval *object) /* {{{ */
+ zend_objects_clone_members(new_object, old_object);
+
+ return new_object;
+-} /* }}} */
++}
+
+-static HashTable *php_ref_get_debug_info(zval *object, int *is_temp) /* {{{ */
++static HashTable *php_ref_get_debug_info(zval *object, int *is_temp)
+ {
+ HashTable *debug_info;
+ zend_string *key;
+@@ -525,9 +525,9 @@ static HashTable *php_ref_get_debug_info(zval *object, int *is_temp) /* {{{ */
+ zend_string_release(key);
+
+ return debug_info;
+-}/* }}} */
++}
+
+-static int php_ref_compare_objects(zval *object1, zval *object2) /* {{{ */
++static int php_ref_compare_objects(zval *object1, zval *object2)
+ {
+ zval result;
+ int res;
+@@ -561,9 +561,9 @@ static int php_ref_compare_objects(zval *object1, zval *object2) /* {{{ */
+
+ /* Compare standard objects */
+ return std_object_handlers.compare_objects(object1, object2);
+-} /* }}} */
++}
+
+-static PHP_METHOD(WeakReference, __construct) /* {{{ */
++static PHP_METHOD(WeakReference, __construct)
+ {
+ zval *referent_zv;
+ zval *notifier_zv = NULL;
+@@ -573,9 +573,9 @@ static PHP_METHOD(WeakReference, __construct) /* {{{ */
+ }
+
+ php_ref_reference_init(getThis(), referent_zv, notifier_zv);
+-} /* }}} */
++}
+
+-static PHP_METHOD(WeakReference, get) /* {{{ */
++static PHP_METHOD(WeakReference, get)
+ {
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+@@ -588,9 +588,9 @@ static PHP_METHOD(WeakReference, get) /* {{{ */
+ }
+
+ RETURN_ZVAL(&reference->referent->this_ptr, 1, 0);
+-} /* }}} */
++}
+
+-static PHP_METHOD(WeakReference, valid) /* {{{ */
++static PHP_METHOD(WeakReference, valid)
+ {
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+@@ -599,9 +599,9 @@ static PHP_METHOD(WeakReference, valid) /* {{{ */
+ PHP_REF_REFERENCE_FETCH_INTO(getThis(), reference);
+
+ RETURN_BOOL(NULL != reference->referent);
+-} /* }}} */
++}
+
+-static PHP_METHOD(WeakReference, notifier) /* {{{ */
++static PHP_METHOD(WeakReference, notifier)
+ {
+ zval *notifier_zv = NULL;
+
+@@ -633,7 +633,7 @@ static PHP_METHOD(WeakReference, notifier) /* {{{ */
+
+ reference->notifier_type = notifier_type;
+
+-} /* }}} */
++}
+
+
+ ZEND_BEGIN_ARG_INFO_EX(arginfo_ref_reference___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1)
+@@ -652,7 +652,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ref_reference_notifier, ZEND_SEND_BY_VAL, ZEND_RE
+ ZEND_END_ARG_INFO()
+
+
+-static const zend_function_entry php_ref_abstract_reference_methods[] = { /* {{{ */
++static const zend_function_entry php_ref_abstract_reference_methods[] = {
+ PHP_ME(WeakReference, __construct, arginfo_ref_reference___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
+
+ PHP_ME(WeakReference, get, arginfo_ref_reference_get, ZEND_ACC_PUBLIC)
+@@ -660,18 +660,18 @@ static const zend_function_entry php_ref_abstract_reference_methods[] = { /* {{{
+ PHP_ME(WeakReference, notifier, arginfo_ref_reference_notifier, ZEND_ACC_PUBLIC)
+
+ PHP_FE_END
+-}; /* }}} */
++};
+
+-static const zend_function_entry php_ref_weak_reference_methods[] = { /* {{{ */
++static const zend_function_entry php_ref_weak_reference_methods[] = {
+ PHP_FE_END
+-}; /* }}} */
++};
+
+-static const zend_function_entry php_ref_soft_reference_methods[] = { /* {{{ */
++static const zend_function_entry php_ref_soft_reference_methods[] = {
+ PHP_FE_END
+-}; /* }}} */
++};
+
+
+-PHP_MINIT_FUNCTION (php_ref_reference) /* {{{ */
++PHP_MINIT_FUNCTION (php_ref_reference)
+ {
+ zend_class_entry ce;
+
+@@ -701,14 +701,4 @@ PHP_MINIT_FUNCTION (php_ref_reference) /* {{{ */
+ php_ref_weak_reference_class_entry->create_object = php_ref_weak_reference_ctor;
+
+ return SUCCESS;
+-} /* }}} */
+-
+-
+-/*
+- * Local variables:
+- * tab-width: 4
+- * c-basic-offset: 4
+- * End:
+- * vim600: noet sw=4 ts=4 fdm=marker
+- * vim<600: noet sw=4 ts=4
+- */
++}
+diff --git a/php_ref_reference.h b/php_ref_reference.h
+index 8b13472..febbb79 100644
+--- a/php_ref_reference.h
++++ b/php_ref_reference.h
+@@ -72,13 +72,3 @@ PHP_MINIT_FUNCTION(php_ref_reference);
+
+
+ #endif /* PHP_REF_REFERENCE_H */
+-
+-
+-/*
+- * Local variables:
+- * tab-width: 4
+- * c-basic-offset: 4
+- * End:
+- * vim600: noet sw=4 ts=4 fdm=marker
+- * vim<600: noet sw=4 ts=4
+- */
+diff --git a/ref.c b/ref.c
+index 178b225..8ff9e48 100644
+--- a/ref.c
++++ b/ref.c
+@@ -26,28 +26,28 @@ ZEND_DECLARE_MODULE_GLOBALS(ref)
+ /* True global resources - no need for thread safety here */
+ static int le_ref;
+
+-PHP_MINIT_FUNCTION(ref) /* {{{ */
++PHP_MINIT_FUNCTION(ref)
+ {
+ PHP_MINIT(php_ref_notifier_exception)(INIT_FUNC_ARGS_PASSTHRU);
+ PHP_MINIT(php_ref_reference)(INIT_FUNC_ARGS_PASSTHRU);
+
+ return SUCCESS;
+-} /* }}} */
++}
+
+-PHP_MSHUTDOWN_FUNCTION(ref) /* {{{ */
++PHP_MSHUTDOWN_FUNCTION(ref)
+ {
+ return SUCCESS;
+-} /* }}} */
++}
+
+-PHP_RINIT_FUNCTION(ref) /* {{{ */
++PHP_RINIT_FUNCTION(ref)
+ {
+ #if defined(COMPILE_DL_REF) && defined(ZTS)
+ ZEND_TSRMLS_CACHE_UPDATE();
+ #endif
+ return SUCCESS;
+-} /* }}} */
++}
+
+-PHP_RSHUTDOWN_FUNCTION(ref) /* {{{ */
++PHP_RSHUTDOWN_FUNCTION(ref)
+ {
+ if (NULL != PHP_REF_G(referents)) {
+ zend_hash_destroy(PHP_REF_G(referents));
+@@ -56,10 +56,10 @@ PHP_RSHUTDOWN_FUNCTION(ref) /* {{{ */
+ }
+
+ return SUCCESS;
+-} /* }}} */
++}
+
+
+-PHP_MINFO_FUNCTION(ref) /* {{{ */
++PHP_MINFO_FUNCTION(ref)
+ {
+ php_info_print_table_start();
+ php_info_print_table_header(2, "Ref support", "enabled");
+@@ -68,14 +68,14 @@ PHP_MINFO_FUNCTION(ref) /* {{{ */
+ php_info_print_table_row(2, "Compiled", __DATE__ " @ " __TIME__);
+
+ php_info_print_table_end();
+-} /* }}} */
++}
+
+-static PHP_GINIT_FUNCTION(ref) /* {{{ */
++static PHP_GINIT_FUNCTION(ref)
+ {
+ ref_globals->referents = NULL;
+-} /* }}} */
++}
+
+-zend_module_entry php_ref_module_entry = { /* {{{ */
++zend_module_entry php_ref_module_entry = {
+ STANDARD_MODULE_HEADER,
+ "ref",
+ php_ref_functions,
+@@ -90,7 +90,7 @@ zend_module_entry php_ref_module_entry = { /* {{{ */
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
+-}; /* }}} */
++};
+
+ #ifdef COMPILE_DL_REF
+ #ifdef ZTS
+@@ -98,12 +98,3 @@ ZEND_TSRMLS_CACHE_DEFINE();
+ #endif
+ ZEND_GET_MODULE(php_ref)
+ #endif
+-
+-/*
+- * Local variables:
+- * tab-width: 4
+- * c-basic-offset: 4
+- * End:
+- * vim600: noet sw=4 ts=4 fdm=marker
+- * vim<600: noet sw=4 ts=4
+- */
diff --git a/20.patch b/20.patch
new file mode 100644
index 0000000..3fe6f1c
--- /dev/null
+++ b/20.patch
@@ -0,0 +1,107 @@
+From e85a6e998f8be04d0fdfaa88c1f57d6c61bf5db6 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Wed, 28 Jun 2017 17:00:11 +0200
+Subject: [PATCH] fix for PHP 7.2 API changes
+
+---
+ php_ref.h | 16 ++++++++++++++++
+ php_ref_functions.c | 20 ++++++++++----------
+ php_ref_reference.c | 2 +-
+ 3 files changed, 27 insertions(+), 11 deletions(-)
+
+diff --git a/php_ref.h b/php_ref.h
+index bbbc4cc..9652a81 100644
+--- a/php_ref.h
++++ b/php_ref.h
+@@ -56,4 +56,20 @@ ZEND_EXTERN_MODULE_GLOBALS(ref);
+ ZEND_TSRMLS_CACHE_EXTERN();
+ #endif
+
++#if PHP_VERSION_ID >= 70200
++
++#define REF_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX
++#define REF_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX
++
++#else
++
++#define REF_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) \
++ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, NULL, allow_null)
++
++#define REF_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, classname, allow_null) \
++ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, IS_OBJECT, classname, allow_null)
++
++#endif
++
++
+ #endif /* PHP_REF_H */
+diff --git a/php_ref_functions.c b/php_ref_functions.c
+index aa03a91..8af8b0e 100644
+--- a/php_ref_functions.c
++++ b/php_ref_functions.c
+@@ -208,43 +208,43 @@ PHP_FUNCTION(is_obj_destructor_called)
+ }
+
+
+-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(refcounted_arg, ZEND_RETURN_VALUE, 1, _IS_BOOL, NULL, 0)
++REF_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(refcounted_arg, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0)
+ ZEND_ARG_INFO(0, value)
+ ZEND_END_ARG_INFO()
+
+-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(refcount_arg, ZEND_RETURN_VALUE, 1, IS_LONG, NULL, 0)
++REF_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(refcount_arg, ZEND_RETURN_VALUE, 1, IS_LONG, 0)
+ ZEND_ARG_INFO(0, value)
+ ZEND_END_ARG_INFO()
+
+-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(softrefcounted_arg, ZEND_RETURN_VALUE, 1, _IS_BOOL, NULL, 0)
++REF_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(softrefcounted_arg, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0)
+ ZEND_ARG_INFO(0, object)
+ ZEND_END_ARG_INFO()
+
+-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(softrefcount_arg, ZEND_RETURN_VALUE, 1, IS_LONG, NULL, 0)
++REF_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(softrefcount_arg, ZEND_RETURN_VALUE, 1, IS_LONG, 0)
+ ZEND_ARG_INFO(0, object)
+ ZEND_END_ARG_INFO()
+
+-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(softrefs_arg, ZEND_RETURN_VALUE, 1, IS_ARRAY, NULL, 0)
++REF_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(softrefs_arg, ZEND_RETURN_VALUE, 1, IS_ARRAY, 0)
+ ZEND_ARG_INFO(0, object)
+ ZEND_END_ARG_INFO()
+
+-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(weakrefcounted_arg, ZEND_RETURN_VALUE, 1, _IS_BOOL, NULL, 0)
++REF_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(weakrefcounted_arg, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0)
+ ZEND_ARG_INFO(0, object)
+ ZEND_END_ARG_INFO()
+
+-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(weakrefcount_arg, ZEND_RETURN_VALUE, 1, IS_LONG, NULL, 0)
++REF_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(weakrefcount_arg, ZEND_RETURN_VALUE, 1, IS_LONG, 0)
+ ZEND_ARG_INFO(0, object)
+ ZEND_END_ARG_INFO()
+
+-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(weakrefs_arg, ZEND_RETURN_VALUE, 1, IS_ARRAY, NULL, 0)
++REF_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(weakrefs_arg, ZEND_RETURN_VALUE, 1, IS_ARRAY, 0)
+ ZEND_ARG_INFO(0, object)
+ ZEND_END_ARG_INFO()
+
+-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(object_handle_arg, ZEND_RETURN_VALUE, 1, IS_LONG, NULL, 0)
++REF_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(object_handle_arg, ZEND_RETURN_VALUE, 1, IS_LONG, 0)
+ ZEND_ARG_INFO(0, object)
+ ZEND_END_ARG_INFO()
+
+-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(is_obj_destructor_called_arg, ZEND_RETURN_VALUE, 1, _IS_BOOL, NULL, 0)
++REF_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(is_obj_destructor_called_arg, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0)
+ ZEND_ARG_INFO(0, object)
+ ZEND_END_ARG_INFO()
+
+diff --git a/php_ref_reference.c b/php_ref_reference.c
+index 8c643bc..0863dc4 100644
+--- a/php_ref_reference.c
++++ b/php_ref_reference.c
+@@ -644,7 +644,7 @@ ZEND_END_ARG_INFO()
+ ZEND_BEGIN_ARG_INFO_EX(arginfo_ref_reference_get, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0)
+ ZEND_END_ARG_INFO()
+
+-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ref_reference_valid, ZEND_RETURN_VALUE, 0, _IS_BOOL, NULL, 0)
++REF_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ref_reference_valid, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0)
+ ZEND_END_ARG_INFO()
+
+ ZEND_BEGIN_ARG_INFO_EX(arginfo_ref_reference_notifier, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0)
diff --git a/php-pecl-ref.spec b/php-pecl-ref.spec
index 2393c35..9af5ae4 100644
--- a/php-pecl-ref.spec
+++ b/php-pecl-ref.spec
@@ -19,12 +19,15 @@
Summary: Soft and Weak references support in PHP
Name: %{?sub_prefix}php-pecl-%{pecl_name}
Version: 0.4.2
-Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
+Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
License: PHP
Group: Development/Languages
URL: http://pecl.php.net/package/%{pecl_name}
+Patch0: 01a154bc126333e03f2c98117e79059553760001.patch
+Patch1: 20.patch
+
BuildRequires: %{?scl_prefix}php-devel >= 7.0.3
BuildRequires: %{?scl_prefix}php-pear
@@ -49,6 +52,10 @@ Obsoletes: php70w-pecl-%{pecl_name} <= %{version}
Obsoletes: php71u-pecl-%{pecl_name} <= %{version}
Obsoletes: php71w-pecl-%{pecl_name} <= %{version}
%endif
+%if "%{php_version}" > "7.2"
+Obsoletes: php72u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php72w-pecl-%{pecl_name} <= %{version}
+%endif
%endif
%if 0%{?fedora} < 20 && 0%{?rhel} < 7
@@ -75,6 +82,9 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
cd NTS
+%patch0 -p1 -b .upstream
+%patch1 -p1 -b .pr20
+
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_REF_VERSION/{s/.* "//;s/".*$//;p}' php_ref.h)
if test "x${extver}" != "x%{version}%{?versuf}"; then
@@ -213,6 +223,10 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Wed Jun 28 2017 Remi Collet <remi@remirepo.net> - 0.4.2-2
+- add patch for PHP 7.2 from
+ https://github.com/pinepain/php-ref/pull/20
+
* Mon Mar 6 2017 Remi Collet <remi@remirepo.net> - 0.4.2-1
- Update to 0.4.2 (stable)