aboutsummaryrefslogtreecommitdiff
path: root/devel/pecl-runkit
diff options
context:
space:
mode:
authorGreg Larkin <glarkin@FreeBSD.org>2010-04-13 04:09:26 +0000
committerGreg Larkin <glarkin@FreeBSD.org>2010-04-13 04:09:26 +0000
commite1942a058016be7c4545da7a936dd131906f785f (patch)
treefc9979dc5e7a7451f301c35d4aa3d359bc5d7668 /devel/pecl-runkit
parent820df8b4d60f6ecde96c31a6bc30add1f815c360 (diff)
Notes
Diffstat (limited to 'devel/pecl-runkit')
-rw-r--r--devel/pecl-runkit/Makefile2
-rw-r--r--devel/pecl-runkit/files/patch-php520fix29
-rw-r--r--devel/pecl-runkit/files/patch-php_runkit.h16
-rw-r--r--devel/pecl-runkit/files/patch-runkit.c13
-rw-r--r--devel/pecl-runkit/files/patch-runkit_constants.c13
-rw-r--r--devel/pecl-runkit/files/patch-runkit_import.c13
-rw-r--r--devel/pecl-runkit/files/patch-runkit_props.c13
-rw-r--r--devel/pecl-runkit/files/patch-runkit_sandbox.c125
8 files changed, 193 insertions, 31 deletions
diff --git a/devel/pecl-runkit/Makefile b/devel/pecl-runkit/Makefile
index 3bb3ed8a55d4..f36a7012b780 100644
--- a/devel/pecl-runkit/Makefile
+++ b/devel/pecl-runkit/Makefile
@@ -17,8 +17,6 @@ DIST_SUBDIR= PECL
MAINTAINER= pav@FreeBSD.org
COMMENT= PECL extension to modify constants, user-defined functions and classes
-BROKEN= does not compile with php 5.3
-
USE_PHP= yes
USE_PHPEXT= yes
PHP_MODNAME= runkit
diff --git a/devel/pecl-runkit/files/patch-php520fix b/devel/pecl-runkit/files/patch-php520fix
deleted file mode 100644
index 6b690e74fe14..000000000000
--- a/devel/pecl-runkit/files/patch-php520fix
+++ /dev/null
@@ -1,29 +0,0 @@
---- php_runkit.h 2006/06/07 17:35:33 1.29
-+++ php_runkit.h 2006/10/26 16:18:52 1.30
-@@ -40,6 +40,13 @@
- #define PHP_RUNKIT_IMPORT_CLASS_PROPS 0x0008
- #define PHP_RUNKIT_IMPORT_CLASSES (PHP_RUNKIT_IMPORT_CLASS_METHODS|PHP_RUNKIT_IMPORT_CLASS_CONSTS|PHP_RUNKIT_IMPORT_CLASS_PROPS)
- #define PHP_RUNKIT_IMPORT_OVERRIDE 0x0010
-+
-+#if ZEND_MODULE_API_NO > 20050922
-+#define ZEND_ENGINE_2_2
-+#endif
-+#if ZEND_MODULE_API_NO > 20050921
-+#define ZEND_ENGINE_2_1
-+#endif
-
- /* The TSRM interpreter patch required by runkit_sandbox was added in 5.1, but this package includes diffs for older versions
- * Those diffs include an additional #define to indicate that they've been applied
---- runkit_import.c 2006/06/07 17:35:33 1.9
-+++ runkit_import.c 2006/10/26 16:18:52 1.10
-@@ -228,7 +228,9 @@
- if (zend_hash_get_current_key_ex(&ce->default_properties, &key, &key_len, &idx, 0, &pos) == HASH_KEY_IS_STRING) {
- char *cname = NULL, *pname = key;
-
--#ifdef ZEND_ENGINE_2
-+#ifdef ZEND_ENGINE_2_2
-+ zend_unmangle_property_name(key, key_len - 1, &cname, &pname);
-+#elif defined(ZEND_ENGINE_2)
- zend_unmangle_property_name(key, &cname, &pname);
- #endif
- if (zend_hash_exists(&dce->default_properties, key, key_len)) {
diff --git a/devel/pecl-runkit/files/patch-php_runkit.h b/devel/pecl-runkit/files/patch-php_runkit.h
new file mode 100644
index 000000000000..3dca7fc16d0d
--- /dev/null
+++ b/devel/pecl-runkit/files/patch-php_runkit.h
@@ -0,0 +1,16 @@
+--- ./php_runkit.h.orig 2006-06-06 17:06:08.000000000 -0400
++++ ./php_runkit.h 2010-04-13 00:04:47.000000000 -0400
+@@ -41,6 +41,13 @@
+ #define PHP_RUNKIT_IMPORT_CLASSES (PHP_RUNKIT_IMPORT_CLASS_METHODS|PHP_RUNKIT_IMPORT_CLASS_CONSTS|PHP_RUNKIT_IMPORT_CLASS_PROPS)
+ #define PHP_RUNKIT_IMPORT_OVERRIDE 0x0010
+
++#if ZEND_MODULE_API_NO > 20050922
++#define ZEND_ENGINE_2_2
++#endif
++#if ZEND_MODULE_API_NO > 20050921
++#define ZEND_ENGINE_2_1
++#endif
++
+ /* The TSRM interpreter patch required by runkit_sandbox was added in 5.1, but this package includes diffs for older versions
+ * Those diffs include an additional #define to indicate that they've been applied
+ */
diff --git a/devel/pecl-runkit/files/patch-runkit.c b/devel/pecl-runkit/files/patch-runkit.c
new file mode 100644
index 000000000000..2acd62484d34
--- /dev/null
+++ b/devel/pecl-runkit/files/patch-runkit.c
@@ -0,0 +1,13 @@
+--- ./runkit.c.orig 2006-06-06 17:06:08.000000000 -0400
++++ ./runkit.c 2010-04-13 00:04:47.000000000 -0400
+@@ -58,8 +58,8 @@
+ addr_len = spprintf(&addr, 0, "0x%0lx", (long)value);
+ add_assoc_stringl(return_value, "address", addr, addr_len, 0);
+
+- add_assoc_long(return_value, "refcount", value->refcount);
+- add_assoc_bool(return_value, "is_ref", value->is_ref);
++ add_assoc_long(return_value, "refcount", Z_REFCOUNT_P(value));
++ add_assoc_bool(return_value, "is_ref", Z_ISREF_P(value));
+ add_assoc_long(return_value, "type", value->type);
+ }
+ /* }}} */
diff --git a/devel/pecl-runkit/files/patch-runkit_constants.c b/devel/pecl-runkit/files/patch-runkit_constants.c
new file mode 100644
index 000000000000..00139494d37f
--- /dev/null
+++ b/devel/pecl-runkit/files/patch-runkit_constants.c
@@ -0,0 +1,13 @@
+--- ./runkit_constants.c.orig 2006-06-06 17:06:08.000000000 -0400
++++ ./runkit_constants.c 2010-04-13 00:06:11.000000000 -0400
+@@ -197,8 +197,8 @@
+ ALLOC_ZVAL(copyval);
+ *copyval = *value;
+ zval_copy_ctor(copyval);
+- copyval->refcount = 1;
+- copyval->is_ref = 0;
++ Z_SET_REFCOUNT_P(copyval, 1);
++ Z_UNSET_ISREF_P(copyval);
+ if (zend_hash_add(&ce->constants_table, constname, constname_len + 1, &copyval, sizeof(zval *), NULL) == FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to add constant to class definition");
+ zval_ptr_dtor(&copyval);
diff --git a/devel/pecl-runkit/files/patch-runkit_import.c b/devel/pecl-runkit/files/patch-runkit_import.c
new file mode 100644
index 000000000000..757e1813b314
--- /dev/null
+++ b/devel/pecl-runkit/files/patch-runkit_import.c
@@ -0,0 +1,13 @@
+--- ./runkit_import.c.orig 2006-06-06 17:06:08.000000000 -0400
++++ ./runkit_import.c 2010-04-13 00:04:47.000000000 -0400
+@@ -226,7 +226,9 @@
+ if (zend_hash_get_current_key_ex(&ce->default_properties, &key, &key_len, &idx, 0, &pos) == HASH_KEY_IS_STRING) {
+ char *cname = NULL, *pname = key;
+
+-#ifdef ZEND_ENGINE_2
++#ifdef ZEND_ENGINE_2_2
++ zend_unmangle_property_name(key, key_len - 1, &cname, &pname);
++#elif defined(ZEND_ENGINE_2)
+ zend_unmangle_property_name(key, &cname, &pname);
+ #endif
+ if (zend_hash_exists(&dce->default_properties, key, key_len)) {
diff --git a/devel/pecl-runkit/files/patch-runkit_props.c b/devel/pecl-runkit/files/patch-runkit_props.c
new file mode 100644
index 000000000000..04fcdd10abc6
--- /dev/null
+++ b/devel/pecl-runkit/files/patch-runkit_props.c
@@ -0,0 +1,13 @@
+--- ./runkit_props.c.orig 2006-06-06 17:06:08.000000000 -0400
++++ ./runkit_props.c 2010-04-13 00:04:47.000000000 -0400
+@@ -124,8 +124,8 @@
+ ALLOC_ZVAL(copyval);
+ *copyval = *value;
+ zval_copy_ctor(copyval);
+- copyval->refcount = 1;
+- copyval->is_ref = 0;
++ Z_SET_REFCOUNT_P(copyval, 1);
++ Z_UNSET_ISREF_P(copyval);
+
+ if (zend_hash_add(&ce->default_properties, key, key_len + 1, &copyval, sizeof(zval *), NULL) == FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to add default property to class definition");
diff --git a/devel/pecl-runkit/files/patch-runkit_sandbox.c b/devel/pecl-runkit/files/patch-runkit_sandbox.c
new file mode 100644
index 000000000000..630f8e14f27b
--- /dev/null
+++ b/devel/pecl-runkit/files/patch-runkit_sandbox.c
@@ -0,0 +1,125 @@
+--- ./runkit_sandbox.c.orig 2006-06-06 17:06:08.000000000 -0400
++++ ./runkit_sandbox.c 2010-04-13 00:04:47.000000000 -0400
+@@ -728,7 +728,7 @@
+ /* ZE expects refcount == 0 for unowned values */
+ INIT_PZVAL(return_value);
+ PHP_SANDBOX_CROSS_SCOPE_ZVAL_COPY_CTOR(return_value);
+- return_value->refcount--;
++ Z_DELREF_P(return_value);
+
+ return return_value;
+ } else {
+@@ -801,7 +801,7 @@
+ member_copy = *member;
+ member = &member_copy;
+ zval_copy_ctor(member);
+- member->refcount = 1;
++ Z_SET_REFCOUNT_P(member, 1);
+ convert_to_string(member);
+ }
+
+@@ -875,7 +875,7 @@
+ member_copy = *member;
+ member = &member_copy;
+ zval_copy_ctor(member);
+- member->refcount = 1;
++ Z_SET_REFCOUNT_P(member, 1);
+ convert_to_string(member);
+ }
+
+@@ -1391,7 +1391,7 @@
+
+ zval_copy_ctor(&callback_copy);
+ callback_copy.is_ref = 0;
+- callback_copy.refcount = 1;
++ Z_SET_REFCOUNT(callback_copy, 1);
+ callback_is_true = zval_is_true(&callback_copy);
+ zval_dtor(&callback_copy);
+ }
+@@ -1411,7 +1411,7 @@
+ if (objval->output_handler && return_value_used) {
+ *return_value = *objval->output_handler;
+ zval_copy_ctor(return_value);
+- return_value->refcount = 1;
++ Z_SET_REFCOUNT_P(return_value, 1);
+ return_value->is_ref = 0;
+ } else {
+ RETVAL_FALSE;
+@@ -1432,10 +1432,10 @@
+ MAKE_STD_ZVAL(cb);
+ *cb = *callback;
+ zval_copy_ctor(cb);
+- cb->refcount = 0;
+- cb->is_ref = 0;
++ Z_SET_REFCOUNT_P(cb, 0);
++ Z_UNSET_ISREF_P(cb);
+ }
+- cb->refcount++;
++ Z_ADDREF_P(cb);
+ objval->output_handler = cb;
+ }
+ }
+@@ -1469,8 +1469,8 @@
+ ALLOC_ZVAL(retval); \
+ Z_TYPE_P(retval) = IS_BOOL; \
+ Z_BVAL_P(retval) = objval->name; \
+- retval->refcount = 0; \
+- retval->is_ref = 0; \
++ Z_SET_REFCOUNT_P(retval, 0); \
++ Z_UNSET_ISREF_P(retval); \
+ \
+ return retval; \
+ }
+@@ -1497,7 +1497,7 @@
+ zval_ptr_dtor(&objval->output_handler);
+ }
+
+- value->refcount++;
++ Z_ADDREF_P(value);
+ objval->output_handler = value;
+ }
+
+@@ -1512,7 +1512,7 @@
+ } else {
+ ZVAL_LONG(retval, objval->parent_scope);
+ }
+- retval->refcount = 0;
++ Z_SET_REFCOUNT_P(retval, 0);
+
+ return retval;
+ }
+@@ -1618,7 +1618,7 @@
+ member_copy = *member;
+ member = &member_copy;
+ zval_copy_ctor(member);
+- member->refcount = 1;
++ Z_SET_REFCOUNT_P(member, 1);
+ convert_to_string(member);
+ }
+
+@@ -1654,7 +1654,7 @@
+ member_copy = *member;
+ member = &member_copy;
+ zval_copy_ctor(member);
+- member->refcount = 1;
++ Z_SET_REFCOUNT_P(member, 1);
+ convert_to_string(member);
+ }
+
+@@ -1690,7 +1690,7 @@
+ member_copy = *member;
+ member = &member_copy;
+ zval_copy_ctor(member);
+- member->refcount = 1;
++ Z_SET_REFCOUNT_P(member, 1);
+ convert_to_string(member);
+ }
+
+@@ -1714,7 +1714,6 @@
+ * Class Definition *
+ ******************** */
+
+-static
+ ZEND_BEGIN_ARG_INFO_EX(php_runkit_require_two_args, 0, 0, 2)
+ ZEND_ARG_PASS_INFO(0)
+ ZEND_ARG_PASS_INFO(0)