ports/174705: New port: devel/php5-ice

Sébastien Santoro dereckson at gmail.com
Tue Dec 25 18:00:01 UTC 2012


>Number:         174705
>Category:       ports
>Synopsis:       New port: devel/php5-ice
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 25 18:00:00 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Sébastien Santoro
>Release:        8.1-RELEASE
>Organization:
>Environment:
FreeBSD grip.espace-win.org 8.1-RELEASE-p11 FreeBSD 8.1-RELEASE-p11 #0: Mon Jun 11 21:02:13 UTC 2012     root at i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
Update devel/php5-ice, so it's compatible with current PHP versions.

The files/ contained 28 new patch files. There are a patch released upstream to get PHP 5.4 compatibility.

Taking over maintainership (currently this is ports@ orphan port).


[ NOTE ]

Before you merge this patch, would you be so kind to repocopy the current port directory into php53-ice for legacy support (svn cp php5-ice php53-ice)?

Thank you.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: files/patch-php-src-IcePHP-Proxy.cpp
===================================================================
--- files/patch-php-src-IcePHP-Proxy.cpp	(revision 0)
+++ files/patch-php-src-IcePHP-Proxy.cpp	(revision 0)
@@ -0,0 +1,59 @@
+diff --git php/src/IcePHP/Proxy.cpp php/src/IcePHP/Proxy.cpp
+index 6aa8d38..89952c4 100644
+--- php/src/IcePHP/Proxy.cpp
++++ php/src/IcePHP/Proxy.cpp
+@@ -59,7 +59,11 @@ extern "C"
+ static zend_object_value handleAlloc(zend_class_entry* TSRMLS_DC);
+ static void handleFreeStorage(void* TSRMLS_DC);
+ static zend_object_value handleClone(zval* TSRMLS_DC);
++#if PHP_VERSION_ID < 50400
+ static union _zend_function* handleGetMethod(zval**, char*, int TSRMLS_DC);
++#else
++static union _zend_function* handleGetMethod(zval**, char*, int, const _zend_literal* TSRMLS_DC);
++#endif
+ static int handleCompare(zval*, zval* TSRMLS_DC);
+ }
+ 
+@@ -1418,7 +1422,8 @@ handleFreeStorage(void* p TSRMLS_DC)
+ {
+     Wrapper<ProxyPtr>* obj = static_cast<Wrapper<ProxyPtr>*>(p);
+     delete obj->ptr;
+-    zend_objects_free_object_storage(static_cast<zend_object*>(p) TSRMLS_CC);
++    zend_object_std_dtor(static_cast<zend_object*>(p) TSRMLS_CC);
++    efree(p);
+ }
+ 
+ #ifdef _WIN32
+@@ -1461,7 +1466,11 @@ handleClone(zval* zv TSRMLS_DC)
+ extern "C"
+ #endif
+ static union _zend_function*
++#if PHP_VERSION_ID < 50400
+ handleGetMethod(zval** zv, char* method, int len TSRMLS_DC)
++#else
++handleGetMethod(zval** zv, char* method, int len, const _zend_literal* key TSRMLS_DC)
++#endif
+ {
+     zend_function* result;
+ 
+@@ -1470,7 +1479,11 @@ handleGetMethod(zval** zv, char* method, int len TSRMLS_DC)
+     // any of our predefined proxy methods. If it returns 0, then we return a
+     // function that will check the class definition.
+     //
++#if PHP_VERSION_ID < 50400
+     result = zend_get_std_object_handlers()->get_method(zv, method, len TSRMLS_CC);
++#else
++    result = zend_get_std_object_handlers()->get_method(zv, method, len, key TSRMLS_CC);
++#endif
+     if(!result)
+     {
+         Wrapper<ProxyPtr>* obj = Wrapper<ProxyPtr>::extract(*zv TSRMLS_CC);
+@@ -1532,7 +1545,7 @@ handleCompare(zval* zobj1, zval* zobj2 TSRMLS_DC)
+ //
+ // Predefined methods for ObjectPrx.
+ //
+-static function_entry _proxyMethods[] =
++static zend_function_entry _proxyMethods[] =
+ {
+     ZEND_ME(Ice_ObjectPrx, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
+     ZEND_ME(Ice_ObjectPrx, __toString, NULL, ZEND_ACC_PUBLIC)
Index: files/patch-php-test-Ice-proxy-Client.php
===================================================================
--- files/patch-php-test-Ice-proxy-Client.php	(revision 0)
+++ files/patch-php-test-Ice-proxy-Client.php	(revision 0)
@@ -0,0 +1,13 @@
+diff --git php/test/Ice/proxy/Client.php php/test/Ice/proxy/Client.php
+index bb4df33..bb9b104 100644
+--- php/test/Ice/proxy/Client.php
++++ php/test/Ice/proxy/Client.php
+@@ -722,7 +722,7 @@ function allTests($communicator)
+     return $cl;
+ }
+ 
+-$communicator = Ice_initialize(&$argv);
++$communicator = Ice_initialize($argv);
+ $myClass = allTests($communicator);
+ $myClass->shutdown();
+ $communicator->destroy();
Index: files/patch-php-test-Ice-exceptions-Client.php
===================================================================
--- files/patch-php-test-Ice-exceptions-Client.php	(revision 0)
+++ files/patch-php-test-Ice-exceptions-Client.php	(revision 0)
@@ -0,0 +1,13 @@
+diff --git php/test/Ice/exceptions/Client.php php/test/Ice/exceptions/Client.php
+index f587cb4..543d5c9 100644
+--- php/test/Ice/exceptions/Client.php
++++ php/test/Ice/exceptions/Client.php
+@@ -378,7 +378,7 @@ function allTests($communicator)
+     return $thrower;
+ }
+ 
+-$communicator = Ice_initialize(&$argv);
++$communicator = Ice_initialize($argv);
+ $thrower = allTests($communicator);
+ $thrower->shutdown();
+ $communicator->destroy();
Index: files/patch-php-src-IcePHP-Util.h
===================================================================
--- files/patch-php-src-IcePHP-Util.h	(revision 0)
+++ files/patch-php-src-IcePHP-Util.h	(revision 0)
@@ -0,0 +1,25 @@
+diff --git php/src/IcePHP/Util.h php/src/IcePHP/Util.h
+index fbe4756..925c0ea 100644
+--- php/src/IcePHP/Util.h
++++ php/src/IcePHP/Util.h
+@@ -22,20 +22,6 @@ ZEND_FUNCTION(Ice_intVersion);
+ ZEND_FUNCTION(Ice_generateUUID);
+ }
+ 
+-#define ICEPHP_UTIL_FUNCTIONS \
+-    ZEND_FE(Ice_stringVersion, NULL) \
+-    ZEND_FE(Ice_intVersion, NULL) \
+-    ZEND_FE(Ice_generateUUID, NULL)
+-
+-#ifdef ICEPHP_USE_NAMESPACES
+-#   define ICEPHP_UTIL_NS_FUNCTIONS \
+-    ZEND_NS_FALIAS("Ice", stringVersion, Ice_stringVersion, NULL) \
+-    ZEND_NS_FALIAS("Ice", intVersion, Ice_intVersion, NULL) \
+-    ZEND_NS_FALIAS("Ice", generateUUID, Ice_generateUUID, NULL)
+-#else
+-#   define ICEPHP_UTIL_NS_FUNCTIONS
+-#endif
+-
+ namespace IcePHP
+ {
+ 
Index: files/patch-php-test-Ice-operations-Client.php
===================================================================
--- files/patch-php-test-Ice-operations-Client.php	(revision 0)
+++ files/patch-php-test-Ice-operations-Client.php	(revision 0)
@@ -0,0 +1,13 @@
+diff --git php/test/Ice/operations/Client.php php/test/Ice/operations/Client.php
+index 90d73a8..6dc88f2 100644
+--- php/test/Ice/operations/Client.php
++++ php/test/Ice/operations/Client.php
+@@ -484,7 +484,7 @@ function allTests($communicator)
+     return $cl;
+ }
+ 
+-$communicator = Ice_initialize(&$argv);
++$communicator = Ice_initialize($argv);
+ 
+ $myClass = allTests($communicator);
+ 
Index: files/patch-php-test-Slice-keyword-Client.php
===================================================================
--- files/patch-php-test-Slice-keyword-Client.php	(revision 0)
+++ files/patch-php-test-Slice-keyword-Client.php	(revision 0)
@@ -0,0 +1,13 @@
+diff --git php/test/Slice/keyword/Client.php php/test/Slice/keyword/Client.php
+index a88749f..b048543 100644
+--- php/test/Slice/keyword/Client.php
++++ php/test/Slice/keyword/Client.php
+@@ -96,7 +96,7 @@ function allTests($communicator)
+     echo "ok\n";
+ }
+ 
+-$communicator = Ice_initialize(&$argv);
++$communicator = Ice_initialize($argv);
+ allTests($communicator);
+ $communicator->destroy();
+ 
Index: files/patch-php-test-Ice-objects-Client.php
===================================================================
--- files/patch-php-test-Ice-objects-Client.php	(revision 0)
+++ files/patch-php-test-Ice-objects-Client.php	(revision 0)
@@ -0,0 +1,13 @@
+diff --git php/test/Ice/objects/Client.php php/test/Ice/objects/Client.php
+index 68b517d..e4589fd 100644
+--- php/test/Ice/objects/Client.php
++++ php/test/Ice/objects/Client.php
+@@ -391,7 +391,7 @@ function allTests($communicator)
+     return $initial;
+ }
+ 
+-$communicator = Ice_initialize(&$argv);
++$communicator = Ice_initialize($argv);
+ $factory = new MyObjectFactory();
+ $communicator->addObjectFactory($factory, "::Test::B");
+ $communicator->addObjectFactory($factory, "::Test::C");
Index: files/patch-php-test-Ice-inheritance-Client.php
===================================================================
--- files/patch-php-test-Ice-inheritance-Client.php	(revision 0)
+++ files/patch-php-test-Ice-inheritance-Client.php	(revision 0)
@@ -0,0 +1,13 @@
+diff --git php/test/Ice/inheritance/Client.php php/test/Ice/inheritance/Client.php
+index e3d9423..a086e24 100644
+--- php/test/Ice/inheritance/Client.php
++++ php/test/Ice/inheritance/Client.php
+@@ -236,7 +236,7 @@ function allTests($communicator)
+     return $initial;
+ }
+ 
+-$communicator = Ice_initialize(&$argv);
++$communicator = Ice_initialize($argv);
+ $initial = allTests($communicator);
+ $initial->shutdown();
+ $communicator->destroy();
Index: files/patch-php-test-Ice-info-Client.php
===================================================================
--- files/patch-php-test-Ice-info-Client.php	(revision 0)
+++ files/patch-php-test-Ice-info-Client.php	(revision 0)
@@ -0,0 +1,13 @@
+diff --git php/test/Ice/info/Client.php php/test/Ice/info/Client.php
+index 719de4a..4679f1e 100644
+--- php/test/Ice/info/Client.php
++++ php/test/Ice/info/Client.php
+@@ -129,7 +129,7 @@ function allTests($communicator)
+     return $testIntf;
+ }
+ 
+-$communicator = Ice_initialize(&$argv);
++$communicator = Ice_initialize($argv);
+ $server = allTests($communicator);
+ $server->shutdown();
+ $communicator->destroy();
Index: files/patch-php-src-IcePHP-Properties.cpp
===================================================================
--- files/patch-php-src-IcePHP-Properties.cpp	(revision 0)
+++ files/patch-php-src-IcePHP-Properties.cpp	(revision 0)
@@ -0,0 +1,28 @@
+diff --git php/src/IcePHP/Properties.cpp php/src/IcePHP/Properties.cpp
+index 9e7a67a..2c91abe 100644
+--- php/src/IcePHP/Properties.cpp
++++ php/src/IcePHP/Properties.cpp
+@@ -493,7 +493,8 @@ handleFreeStorage(void* p TSRMLS_DC)
+ {
+     Wrapper<Ice::PropertiesPtr>* obj = static_cast<Wrapper<Ice::PropertiesPtr>*>(p);
+     delete obj->ptr;
+-    zend_objects_free_object_storage(static_cast<zend_object*>(p) TSRMLS_CC);
++    zend_object_std_dtor(static_cast<zend_object*>(p) TSRMLS_CC);
++    efree(p);
+ }
+ 
+ #ifdef _WIN32
+@@ -589,11 +590,11 @@ ZEND_FUNCTION(Ice_createProperties)
+ //
+ // Predefined methods for Properties.
+ //
+-static function_entry _interfaceMethods[] =
++static zend_function_entry _interfaceMethods[] =
+ {
+     {0, 0, 0}
+ };
+-static function_entry _classMethods[] =
++static zend_function_entry _classMethods[] =
+ {
+     ZEND_ME(Ice_Properties, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
+     ZEND_ME(Ice_Properties, __toString, NULL, ZEND_ACC_PUBLIC)
Index: files/patch-php-src-IcePHP-Connection.cpp
===================================================================
--- files/patch-php-src-IcePHP-Connection.cpp	(revision 0)
+++ files/patch-php-src-IcePHP-Connection.cpp	(revision 0)
@@ -0,0 +1,47 @@
+diff --git php/src/IcePHP/Connection.cpp php/src/IcePHP/Connection.cpp
+index cd1784a..407a6fa 100644
+--- php/src/IcePHP/Connection.cpp
++++ php/src/IcePHP/Connection.cpp
+@@ -236,7 +236,8 @@ handleConnectionFreeStorage(void* p TSRMLS_DC)
+ {
+     Wrapper<Ice::ConnectionPtr>* obj = static_cast<Wrapper<Ice::ConnectionPtr>*>(p);
+     delete obj->ptr;
+-    zend_objects_free_object_storage(static_cast<zend_object*>(p) TSRMLS_CC);
++    zend_object_std_dtor(static_cast<zend_object*>(p) TSRMLS_CC);
++    efree(p);
+ }
+ 
+ #ifdef _WIN32
+@@ -271,11 +272,11 @@ handleConnectionCompare(zval* zobj1, zval* zobj2 TSRMLS_DC)
+ //
+ // Predefined methods for Connection.
+ //
+-static function_entry _interfaceMethods[] =
++static zend_function_entry _interfaceMethods[] =
+ {
+     {0, 0, 0}
+ };
+-static function_entry _connectionClassMethods[] =
++static zend_function_entry _connectionClassMethods[] =
+ {
+     ZEND_ME(Ice_Connection, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
+     ZEND_ME(Ice_Connection, __toString, NULL, ZEND_ACC_PUBLIC)
+@@ -297,7 +298,7 @@ ZEND_METHOD(Ice_ConnectionInfo, __construct)
+ //
+ // Predefined methods for ConnectionInfo.
+ //
+-static function_entry _connectionInfoClassMethods[] =
++static zend_function_entry _connectionInfoClassMethods[] =
+ {
+     ZEND_ME(Ice_ConnectionInfo, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
+     {0, 0, 0}
+@@ -329,7 +330,8 @@ handleConnectionInfoFreeStorage(void* p TSRMLS_DC)
+ {
+     Wrapper<Ice::ConnectionInfoPtr>* obj = static_cast<Wrapper<Ice::ConnectionInfoPtr>*>(p);
+     delete obj->ptr;
+-    zend_objects_free_object_storage(static_cast<zend_object*>(p) TSRMLS_CC);
++    zend_object_std_dtor(static_cast<zend_object*>(p) TSRMLS_CC);
++    efree(p);
+ }
+ 
+ bool
Index: files/patch-php-test-Slice-structure-Client.php
===================================================================
--- files/patch-php-test-Slice-structure-Client.php	(revision 0)
+++ files/patch-php-test-Slice-structure-Client.php	(revision 0)
@@ -0,0 +1,13 @@
+diff --git php/test/Slice/structure/Client.php php/test/Slice/structure/Client.php
+index 8cb1c03..0c73fae 100644
+--- php/test/Slice/structure/Client.php
++++ php/test/Slice/structure/Client.php
+@@ -225,7 +225,7 @@ function allTests($communicator)
+     echo "ok\n";
+ }
+ 
+-$communicator = Ice_initialize(&$argv);
++$communicator = Ice_initialize($argv);
+ allTests($communicator);
+ $communicator->destroy();
+ 
Index: files/patch-php-src-IcePHP-Operation.cpp
===================================================================
--- files/patch-php-src-IcePHP-Operation.cpp	(revision 0)
+++ files/patch-php-src-IcePHP-Operation.cpp	(revision 0)
@@ -0,0 +1,68 @@
+diff --git php/src/IcePHP/Operation.cpp php/src/IcePHP/Operation.cpp
+index 8a6fafe..3e062be 100644
+--- php/src/IcePHP/Operation.cpp
++++ php/src/IcePHP/Operation.cpp
+@@ -218,7 +218,7 @@ IcePHP::OperationI::~OperationI()
+     if(_zendFunction)
+     {
+         delete []_zendFunction->arg_info;
+-        efree(_zendFunction->function_name);
++        efree(const_cast<char*>(_zendFunction->function_name));
+         efree(_zendFunction);
+     }
+ }
+@@ -238,12 +238,16 @@ IcePHP::OperationI::function()
+         for(p = inParams.begin(); p != inParams.end(); ++p, ++i)
+         {
+             getArgInfo(argInfo[i], *p, false);
++#if PHP_VERSION_ID < 50400
+             argInfo[i].required_num_args = static_cast<zend_uint>(numParams);
++#endif
+         }
+         for(p = outParams.begin(); p != outParams.end(); ++p, ++i)
+         {
+             getArgInfo(argInfo[i], *p, true);
++#if PHP_VERSION_ID < 50400
+             argInfo[i].required_num_args = static_cast<zend_uint>(numParams);
++#endif
+         }
+ 
+         string fixed = fixIdent(name);
+@@ -255,9 +259,11 @@ IcePHP::OperationI::function()
+         _zendFunction->prototype = 0;
+         _zendFunction->num_args = static_cast<zend_uint>(numParams);
+         _zendFunction->arg_info = argInfo;
+-        _zendFunction->pass_rest_by_reference = 0;
+         _zendFunction->required_num_args = _zendFunction->num_args;
++#if PHP_VERSION_ID < 50400
++        _zendFunction->pass_rest_by_reference = 0;
+         _zendFunction->return_reference = 0;
++#endif
+         _zendFunction->handler = ZEND_FN(IcePHP_Operation_call);
+     }
+ 
+@@ -293,15 +299,16 @@ IcePHP::OperationI::getArgInfo(zend_arg_info& arg, const TypeInfoPtr& info, bool
+     arg.name = 0;
+     arg.class_name = 0;
+     arg.allow_null = 1;
+-    if(SequenceInfoPtr::dynamicCast(info) || DictionaryInfoPtr::dynamicCast(info))
+-    {
+-        arg.array_type_hint = 1;
+-    }
+-    else
+-    {
+-        arg.array_type_hint = 0;
+-    }
++
++    const bool isArray = SequenceInfoPtr::dynamicCast(info) || DictionaryInfoPtr::dynamicCast(info);
++
++#if PHP_VERSION_ID < 50400
++    arg.array_type_hint = isArray ? 1 : 0;
+     arg.return_reference = 0;
++#else
++    arg.type_hint = isArray ? IS_ARRAY : 0;
++#endif
++
+     arg.pass_by_reference = out ? 1 : 0;
+ }
+ 
Index: files/patch-php-src-IcePHP-Communicator.cpp
===================================================================
--- files/patch-php-src-IcePHP-Communicator.cpp	(revision 0)
+++ files/patch-php-src-IcePHP-Communicator.cpp	(revision 0)
@@ -0,0 +1,60 @@
+diff --git php/src/IcePHP/Communicator.cpp php/src/IcePHP/Communicator.cpp
+index fced1eb..781e175 100644
+--- php/src/IcePHP/Communicator.cpp
++++ php/src/IcePHP/Communicator.cpp
+@@ -716,7 +716,8 @@ handleFreeStorage(void* p TSRMLS_DC)
+ {
+     Wrapper<CommunicatorInfoIPtr>* obj = static_cast<Wrapper<CommunicatorInfoIPtr>*>(p);
+     delete obj->ptr;
+-    zend_objects_free_object_storage(static_cast<zend_object*>(p) TSRMLS_CC);
++    zend_object_std_dtor(static_cast<zend_object*>(p) TSRMLS_CC);
++    efree(p);
+ }
+ 
+ #ifdef _WIN32
+@@ -834,6 +835,7 @@ ZEND_FUNCTION(Ice_initialize)
+ 
+     Ice::StringSeq seq;
+     Ice::InitializationData initData;
++    zval* zvargs = 0;
+     zval* zvinit = 0;
+ 
+     //
+@@ -853,6 +855,7 @@ ZEND_FUNCTION(Ice_initialize)
+             {
+                 RETURN_NULL();
+             }
++            zvargs = *args[0];
+             hasArgs = true;
+             if(ZEND_NUM_ARGS() > 1)
+             {
+@@ -913,6 +916,15 @@ ZEND_FUNCTION(Ice_initialize)
+     {
+         RETURN_NULL();
+     }
++
++    if(zvargs && PZVAL_IS_REF(zvargs))
++    {
++        zval_dtor(zvargs);
++        if(!createStringArray(zvargs, seq TSRMLS_CC))
++        {
++            RETURN_NULL();
++        }
++    }
+ }
+ 
+ ZEND_FUNCTION(Ice_register)
+@@ -1092,11 +1104,11 @@ ZEND_FUNCTION(Ice_getProperties)
+ //
+ // Predefined methods for Communicator.
+ //
+-static function_entry _interfaceMethods[] =
++static zend_function_entry _interfaceMethods[] =
+ {
+     {0, 0, 0}
+ };
+-static function_entry _classMethods[] =
++static zend_function_entry _classMethods[] =
+ {
+     ZEND_ME(Ice_Communicator, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
+     ZEND_ME(Ice_Communicator, destroy, NULL, ZEND_ACC_PUBLIC)
Index: files/patch-php-src-IcePHP-Properties.h
===================================================================
--- files/patch-php-src-IcePHP-Properties.h	(revision 0)
+++ files/patch-php-src-IcePHP-Properties.h	(revision 0)
@@ -0,0 +1,21 @@
+diff --git php/src/IcePHP/Properties.h php/src/IcePHP/Properties.h
+index 797edb5..001e288 100644
+--- php/src/IcePHP/Properties.h
++++ php/src/IcePHP/Properties.h
+@@ -20,16 +20,6 @@ extern "C"
+ ZEND_FUNCTION(Ice_createProperties);
+ }
+ 
+-#define ICEPHP_PROPERTIES_FUNCTIONS \
+-    ZEND_FE(Ice_createProperties, NULL)
+-
+-#ifdef ICEPHP_USE_NAMESPACES
+-#   define ICEPHP_PROPERTIES_NS_FUNCTIONS \
+-    ZEND_NS_FALIAS("Ice", createProperties, Ice_createProperties, NULL)
+-#else
+-#   define ICEPHP_PROPERTIES_NS_FUNCTIONS
+-#endif
+-
+ namespace IcePHP
+ {
+ 
Index: files/patch-php-test-Ice-checksum-Client.php
===================================================================
--- files/patch-php-test-Ice-checksum-Client.php	(revision 0)
+++ files/patch-php-test-Ice-checksum-Client.php	(revision 0)
@@ -0,0 +1,13 @@
+diff --git php/test/Ice/checksum/Client.php php/test/Ice/checksum/Client.php
+index 2de5055..4b514a8 100755
+--- php/test/Ice/checksum/Client.php
++++ php/test/Ice/checksum/Client.php
+@@ -88,7 +88,7 @@ function allTests($communicator)
+     return $checksum;
+ }
+ 
+-$communicator = Ice_initialize(&$argv);
++$communicator = Ice_initialize($argv);
+ $checksum = allTests($communicator);
+ $checksum->shutdown();
+ $communicator->destroy();
Index: files/patch-php-src-IcePHP-Init.cpp
===================================================================
--- files/patch-php-src-IcePHP-Init.cpp	(revision 0)
+++ files/patch-php-src-IcePHP-Init.cpp	(revision 0)
@@ -0,0 +1,79 @@
+diff --git php/src/IcePHP/Init.cpp php/src/IcePHP/Init.cpp
+index e6c5f49..918d822 100644
+--- php/src/IcePHP/Init.cpp
++++ php/src/IcePHP/Init.cpp
+@@ -22,10 +22,73 @@ using namespace IcePHP;
+ 
+ ZEND_DECLARE_MODULE_GLOBALS(ice)
+ 
++ZEND_BEGIN_ARG_INFO(Ice_initialize_arginfo, 1)
++ZEND_END_ARG_INFO()
++
++ZEND_BEGIN_ARG_INFO(Ice_createProperties_arginfo, 1)
++ZEND_END_ARG_INFO()
++
++#define ICEPHP_COMMUNICATOR_FUNCTIONS \
++    ZEND_FE(Ice_initialize, Ice_initialize_arginfo) \
++    ZEND_FE(Ice_register, NULL) \
++    ZEND_FE(Ice_unregister, NULL) \
++    ZEND_FE(Ice_find, NULL) \
++    ZEND_FE(Ice_getProperties, NULL)
++
++#ifdef ICEPHP_USE_NAMESPACES
++#   define ICEPHP_COMMUNICATOR_NS_FUNCTIONS \
++    ZEND_NS_FALIAS("Ice", initialize, Ice_initialize, Ice_initialize_arginfo) \
++    ZEND_NS_FALIAS("Ice", register, Ice_register, NULL) \
++    ZEND_NS_FALIAS("Ice", unregister, Ice_unregister, NULL) \
++    ZEND_NS_FALIAS("Ice", find, Ice_find, NULL) \
++    ZEND_NS_FALIAS("Ice", getProperties, Ice_getProperties, NULL)
++#else
++#   define ICEPHP_COMMUNICATOR_NS_FUNCTIONS
++#endif
++
++#define ICEPHP_OPERATION_FUNCTIONS \
++    ZEND_FE(IcePHP_defineOperation,  NULL)
++
++#define ICEPHP_PROPERTIES_FUNCTIONS \
++    ZEND_FE(Ice_createProperties, Ice_createProperties_arginfo)
++
++#ifdef ICEPHP_USE_NAMESPACES
++#   define ICEPHP_PROPERTIES_NS_FUNCTIONS \
++    ZEND_NS_FALIAS("Ice", createProperties, Ice_createProperties, Ice_createProperties_arginfo)
++#else
++#   define ICEPHP_PROPERTIES_NS_FUNCTIONS
++#endif
++
++#define ICEPHP_TYPE_FUNCTIONS \
++    ZEND_FE(IcePHP_defineEnum,          NULL) \
++    ZEND_FE(IcePHP_defineStruct,        NULL) \
++    ZEND_FE(IcePHP_defineSequence,      NULL) \
++    ZEND_FE(IcePHP_defineDictionary,    NULL) \
++    ZEND_FE(IcePHP_defineProxy,         NULL) \
++    ZEND_FE(IcePHP_declareClass,        NULL) \
++    ZEND_FE(IcePHP_defineClass,         NULL) \
++    ZEND_FE(IcePHP_defineException,     NULL) \
++    ZEND_FE(IcePHP_stringify,           NULL) \
++    ZEND_FE(IcePHP_stringifyException,  NULL)
++
++#define ICEPHP_UTIL_FUNCTIONS \
++    ZEND_FE(Ice_stringVersion, NULL) \
++    ZEND_FE(Ice_intVersion, NULL) \
++    ZEND_FE(Ice_generateUUID, NULL)
++
++#ifdef ICEPHP_USE_NAMESPACES
++#   define ICEPHP_UTIL_NS_FUNCTIONS \
++    ZEND_NS_FALIAS("Ice", stringVersion, Ice_stringVersion, NULL) \
++    ZEND_NS_FALIAS("Ice", intVersion, Ice_intVersion, NULL) \
++    ZEND_NS_FALIAS("Ice", generateUUID, Ice_generateUUID, NULL)
++#else
++#   define ICEPHP_UTIL_NS_FUNCTIONS
++#endif
++
+ //
+ // Entries for all global functions.
+ //
+-function_entry ice_functions[] =
++zend_function_entry ice_functions[] =
+ {
+     ICEPHP_COMMUNICATOR_FUNCTIONS
+     ICEPHP_COMMUNICATOR_NS_FUNCTIONS
Index: files/patch-php-src-IcePHP-Types.cpp
===================================================================
--- files/patch-php-src-IcePHP-Types.cpp	(revision 0)
+++ files/patch-php-src-IcePHP-Types.cpp	(revision 0)
@@ -0,0 +1,42 @@
+diff --git php/src/IcePHP/Types.cpp php/src/IcePHP/Types.cpp
+index 464336f..6df610a 100644
+--- php/src/IcePHP/Types.cpp
++++ php/src/IcePHP/Types.cpp
+@@ -2405,7 +2405,8 @@ handleTypeInfoFreeStorage(void* p TSRMLS_DC)
+ {
+     Wrapper<TypeInfoPtr>* obj = static_cast<Wrapper<TypeInfoPtr>*>(p);
+     delete obj->ptr;
+-    zend_objects_free_object_storage(static_cast<zend_object*>(p) TSRMLS_CC);
++    zend_object_std_dtor(static_cast<zend_object*>(p) TSRMLS_CC);
++    efree(p);
+ }
+ 
+ static bool
+@@ -2718,7 +2719,8 @@ handleExceptionInfoFreeStorage(void* p TSRMLS_DC)
+ {
+     Wrapper<ExceptionInfoPtr>* obj = static_cast<Wrapper<ExceptionInfoPtr>*>(p);
+     delete obj->ptr;
+-    zend_objects_free_object_storage(static_cast<zend_object*>(p) TSRMLS_CC);
++    zend_object_std_dtor(static_cast<zend_object*>(p) TSRMLS_CC);
++    efree(p);
+ }
+ 
+ 
+@@ -2853,7 +2855,7 @@ ZEND_FUNCTION(IcePHP_stringifyException)
+ //
+ // Predefined methods for IcePHP_TypeInfo.
+ //
+-static function_entry _typeInfoMethods[] =
++static zend_function_entry _typeInfoMethods[] =
+ {
+     {0, 0, 0}
+ };
+@@ -2861,7 +2863,7 @@ static function_entry _typeInfoMethods[] =
+ //
+ // Predefined methods for IcePHP_ExceptionInfo.
+ //
+-static function_entry _exceptionInfoMethods[] =
++static zend_function_entry _exceptionInfoMethods[] =
+ {
+     {0, 0, 0}
+ };
Index: files/patch-php-src-IcePHP-Operation.h
===================================================================
--- files/patch-php-src-IcePHP-Operation.h	(revision 0)
+++ files/patch-php-src-IcePHP-Operation.h	(revision 0)
@@ -0,0 +1,14 @@
+diff --git php/src/IcePHP/Operation.h php/src/IcePHP/Operation.h
+index a1bb0eb..265cd6f 100644
+--- php/src/IcePHP/Operation.h
++++ php/src/IcePHP/Operation.h
+@@ -20,9 +20,6 @@ extern "C"
+ ZEND_FUNCTION(IcePHP_defineOperation);
+ }
+ 
+-#define ICEPHP_OPERATION_FUNCTIONS \
+-    ZEND_FE(IcePHP_defineOperation,  NULL)
+-
+ namespace IcePHP
+ {
+ 
Index: files/patch-php-src-IcePHP-Communicator.h
===================================================================
--- files/patch-php-src-IcePHP-Communicator.h	(revision 0)
+++ files/patch-php-src-IcePHP-Communicator.h	(revision 0)
@@ -0,0 +1,29 @@
+diff --git php/src/IcePHP/Communicator.h php/src/IcePHP/Communicator.h
+index c3b928d..02610d0 100644
+--- php/src/IcePHP/Communicator.h
++++ php/src/IcePHP/Communicator.h
+@@ -25,24 +25,6 @@ ZEND_FUNCTION(Ice_find);
+ ZEND_FUNCTION(Ice_getProperties);
+ }
+ 
+-#define ICEPHP_COMMUNICATOR_FUNCTIONS \
+-    ZEND_FE(Ice_initialize, NULL) \
+-    ZEND_FE(Ice_register, NULL) \
+-    ZEND_FE(Ice_unregister, NULL) \
+-    ZEND_FE(Ice_find, NULL) \
+-    ZEND_FE(Ice_getProperties, NULL)
+-
+-#ifdef ICEPHP_USE_NAMESPACES
+-#   define ICEPHP_COMMUNICATOR_NS_FUNCTIONS \
+-    ZEND_NS_FALIAS("Ice", initialize, Ice_initialize, NULL) \
+-    ZEND_NS_FALIAS("Ice", register, Ice_register, NULL) \
+-    ZEND_NS_FALIAS("Ice", unregister, Ice_unregister, NULL) \
+-    ZEND_NS_FALIAS("Ice", find, Ice_find, NULL) \
+-    ZEND_NS_FALIAS("Ice", getProperties, Ice_getProperties, NULL)
+-#else
+-#   define ICEPHP_COMMUNICATOR_NS_FUNCTIONS
+-#endif
+-
+ namespace IcePHP
+ {
+ 
Index: files/patch-php-test-Ice-facets-Client.php
===================================================================
--- files/patch-php-test-Ice-facets-Client.php	(revision 0)
+++ files/patch-php-test-Ice-facets-Client.php	(revision 0)
@@ -0,0 +1,13 @@
+diff --git php/test/Ice/facets/Client.php php/test/Ice/facets/Client.php
+index 00a16dc..6fcdb60 100644
+--- php/test/Ice/facets/Client.php
++++ php/test/Ice/facets/Client.php
+@@ -89,7 +89,7 @@ function allTests($communicator)
+     return $gf;
+ }
+ 
+-$communicator = Ice_initialize(&$argv);
++$communicator = Ice_initialize($argv);
+ $g = allTests($communicator);
+ $g->shutdown();
+ $communicator->destroy();
Index: files/patch-php-test-Ice-slicing-exceptions-Client.php
===================================================================
--- files/patch-php-test-Ice-slicing-exceptions-Client.php	(revision 0)
+++ files/patch-php-test-Ice-slicing-exceptions-Client.php	(revision 0)
@@ -0,0 +1,13 @@
+diff --git php/test/Ice/slicing/exceptions/Client.php php/test/Ice/slicing/exceptions/Client.php
+index 5c671f6..ff114ac 100644
+--- php/test/Ice/slicing/exceptions/Client.php
++++ php/test/Ice/slicing/exceptions/Client.php
+@@ -315,7 +315,7 @@ function allTests($communicator)
+     return $test;
+ }
+ 
+-$communicator = Ice_initialize(&$argv);
++$communicator = Ice_initialize($argv);
+ $test = allTests($communicator);
+ $test->shutdown();
+ $communicator->destroy();
Index: files/patch-php-src-IcePHP-Types.h
===================================================================
--- files/patch-php-src-IcePHP-Types.h	(revision 0)
+++ files/patch-php-src-IcePHP-Types.h	(revision 0)
@@ -0,0 +1,23 @@
+diff --git php/src/IcePHP/Types.h php/src/IcePHP/Types.h
+index 7a1352e..b21af72 100644
+--- php/src/IcePHP/Types.h
++++ php/src/IcePHP/Types.h
+@@ -33,18 +33,6 @@ ZEND_FUNCTION(IcePHP_stringify);
+ ZEND_FUNCTION(IcePHP_stringifyException);
+ }
+ 
+-#define ICEPHP_TYPE_FUNCTIONS \
+-    ZEND_FE(IcePHP_defineEnum,          NULL) \
+-    ZEND_FE(IcePHP_defineStruct,        NULL) \
+-    ZEND_FE(IcePHP_defineSequence,      NULL) \
+-    ZEND_FE(IcePHP_defineDictionary,    NULL) \
+-    ZEND_FE(IcePHP_defineProxy,         NULL) \
+-    ZEND_FE(IcePHP_declareClass,        NULL) \
+-    ZEND_FE(IcePHP_defineClass,         NULL) \
+-    ZEND_FE(IcePHP_defineException,     NULL) \
+-    ZEND_FE(IcePHP_stringify,           NULL) \
+-    ZEND_FE(IcePHP_stringifyException,  NULL)
+-
+ namespace IcePHP
+ {
+ 
Index: files/patch-php-test-Ice-binding-Client.php
===================================================================
--- files/patch-php-test-Ice-binding-Client.php	(revision 0)
+++ files/patch-php-test-Ice-binding-Client.php	(revision 0)
@@ -0,0 +1,13 @@
+diff --git php/test/Ice/binding/Client.php php/test/Ice/binding/Client.php
+index 1a36376..e4fcc58 100644
+--- php/test/Ice/binding/Client.php
++++ php/test/Ice/binding/Client.php
+@@ -525,7 +525,7 @@ function allTests($communicator)
+     $com->shutdown();
+ }
+ 
+-$communicator = Ice_initialize(&$argv);
++$communicator = Ice_initialize($argv);
+ allTests($communicator);
+ $communicator->destroy();
+ exit();
Index: files/patch-php-src-IcePHP-Util.cpp
===================================================================
--- files/patch-php-src-IcePHP-Util.cpp	(revision 0)
+++ files/patch-php-src-IcePHP-Util.cpp	(revision 0)
@@ -0,0 +1,41 @@
+diff --git php/src/IcePHP/Util.cpp php/src/IcePHP/Util.cpp
+index 27abfb5..ef5f371 100644
+--- php/src/IcePHP/Util.cpp
++++ php/src/IcePHP/Util.cpp
+@@ -17,6 +17,7 @@ using namespace std;
+ using namespace IcePHP;
+ using namespace Slice::PHP;
+ 
++#if PHP_VERSION_ID < 50400
+ #ifdef _WIN32
+ extern "C"
+ #endif
+@@ -25,20 +26,25 @@ dtor_wrapper(void* p)
+ {
+     zval_ptr_dtor(static_cast<zval**>(p));
+ }
++#endif
+ 
+ void*
+ IcePHP::createWrapper(zend_class_entry* ce, size_t sz TSRMLS_DC)
+ {
+     zend_object* obj;
+-    zval* tmp;
+ 
+     obj = static_cast<zend_object*>(emalloc(sz));
+-    obj->ce = ce;
+-    obj->guards = 0;
+ 
++    zend_object_std_init(obj, ce TSRMLS_CC);
++
++#if PHP_VERSION_ID < 50400
++    zval* tmp;
+     obj->properties = static_cast<HashTable*>(emalloc(sizeof(HashTable)));
+     zend_hash_init(obj->properties, 0, 0, dtor_wrapper, 0);
+     zend_hash_copy(obj->properties, &ce->default_properties, (copy_ctor_func_t)zval_add_ref, &tmp, sizeof(zval*));
++#else
++    object_properties_init(obj, ce);
++#endif
+ 
+     return obj;
+ }
Index: files/patch-php-src-IcePHP-Logger.cpp
===================================================================
--- files/patch-php-src-IcePHP-Logger.cpp	(revision 0)
+++ files/patch-php-src-IcePHP-Logger.cpp	(revision 0)
@@ -0,0 +1,28 @@
+diff --git php/src/IcePHP/Logger.cpp php/src/IcePHP/Logger.cpp
+index f9514a3..e6d52d0 100644
+--- php/src/IcePHP/Logger.cpp
++++ php/src/IcePHP/Logger.cpp
+@@ -210,7 +210,8 @@ handleFreeStorage(void* p TSRMLS_DC)
+ {
+     Wrapper<Ice::LoggerPtr>* obj = static_cast<Wrapper<Ice::LoggerPtr>*>(p);
+     delete obj->ptr;
+-    zend_objects_free_object_storage(static_cast<zend_object*>(p) TSRMLS_CC);
++    zend_object_std_dtor(static_cast<zend_object*>(p) TSRMLS_CC);
++    efree(p);
+ }
+ 
+ #ifdef _WIN32
+@@ -226,11 +227,11 @@ handleClone(zval* zv TSRMLS_DC)
+ //
+ // Predefined methods for Logger.
+ //
+-static function_entry _interfaceMethods[] =
++static zend_function_entry _interfaceMethods[] =
+ {
+     {0, 0, 0}
+ };
+-static function_entry _classMethods[] =
++static zend_function_entry _classMethods[] =
+ {
+     ZEND_ME(Ice_Logger, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
+     ZEND_ME(Ice_Logger, __toString, NULL, ZEND_ACC_PUBLIC)
Index: files/patch-php-src-IcePHP-Endpoint.cpp
===================================================================
--- files/patch-php-src-IcePHP-Endpoint.cpp	(revision 0)
+++ files/patch-php-src-IcePHP-Endpoint.cpp	(revision 0)
@@ -0,0 +1,46 @@
+diff --git php/src/IcePHP/Endpoint.cpp php/src/IcePHP/Endpoint.cpp
+index de5fe61..4da2aff 100644
+--- php/src/IcePHP/Endpoint.cpp
++++ php/src/IcePHP/Endpoint.cpp
+@@ -115,7 +115,8 @@ handleEndpointFreeStorage(void* p TSRMLS_DC)
+ {
+     Wrapper<Ice::EndpointPtr>* obj = static_cast<Wrapper<Ice::EndpointPtr>*>(p);
+     delete obj->ptr;
+-    zend_objects_free_object_storage(static_cast<zend_object*>(p) TSRMLS_CC);
++    zend_object_std_dtor(static_cast<zend_object*>(p) TSRMLS_CC);
++    efree(p);
+ }
+ 
+ ZEND_METHOD(Ice_EndpointInfo, __construct)
+@@ -213,10 +214,11 @@ handleEndpointInfoFreeStorage(void* p TSRMLS_DC)
+ {
+     Wrapper<Ice::EndpointInfoPtr>* obj = static_cast<Wrapper<Ice::EndpointInfoPtr>*>(p);
+     delete obj->ptr;
+-    zend_objects_free_object_storage(static_cast<zend_object*>(p) TSRMLS_CC);
++    zend_object_std_dtor(static_cast<zend_object*>(p) TSRMLS_CC);
++    efree(p);
+ }
+ 
+-static function_entry _interfaceMethods[] =
++static zend_function_entry _interfaceMethods[] =
+ {
+     {0, 0, 0}
+ };
+@@ -224,7 +226,7 @@ static function_entry _interfaceMethods[] =
+ //
+ // Predefined methods for Endpoint.
+ //
+-static function_entry _endpointMethods[] =
++static zend_function_entry _endpointMethods[] =
+ {
+     ZEND_ME(Ice_Endpoint, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
+     ZEND_ME(Ice_Endpoint, __toString, NULL, ZEND_ACC_PUBLIC)
+@@ -236,7 +238,7 @@ static function_entry _endpointMethods[] =
+ //
+ // Predefined methods for EndpointInfo.
+ //
+-static function_entry _endpointInfoMethods[] =
++static zend_function_entry _endpointInfoMethods[] =
+ {
+     ZEND_ME(Ice_EndpointInfo, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
+     ZEND_ME(Ice_EndpointInfo, type, NULL, ZEND_ACC_PUBLIC)
Index: files/patch-php-test-Ice-slicing-objects-Client.php
===================================================================
--- files/patch-php-test-Ice-slicing-objects-Client.php	(revision 0)
+++ files/patch-php-test-Ice-slicing-objects-Client.php	(revision 0)
@@ -0,0 +1,13 @@
+diff --git php/test/Ice/slicing/objects/Client.php php/test/Ice/slicing/objects/Client.php
+index 6b96933..55d5ac1 100644
+--- php/test/Ice/slicing/objects/Client.php
++++ php/test/Ice/slicing/objects/Client.php
+@@ -830,7 +830,7 @@ function allTests($communicator)
+     return $test;
+ }
+ 
+-$communicator = Ice_initialize(&$argv);
++$communicator = Ice_initialize($argv);
+ $test = allTests($communicator);
+ $test->shutdown();
+ $communicator->destroy();
Index: Makefile
===================================================================
--- Makefile	(revision 309490)
+++ Makefile	(working copy)
@@ -12,7 +12,7 @@
 PKGNAMEPREFIX=	php5-
 DISTNAME=	Ice-${PORTVERSION}
 
-MAINTAINER=	ports at FreeBSD.org
+MAINTAINER=	dereckson at gmail.com
 COMMENT=	An Ice (Internet Communications Engine) language mapping for PHP
 
 LIB_DEPENDS=	Ice.${LIB_VRS}:${PORTSDIR}/devel/ice
@@ -21,8 +21,6 @@
 MAKE_ARGS+=	PHP_EXT_DIR=${PHP_EXT_DIR}
 USE_PHP=	yes
 USE_PHP_BUILD=	yes
-DEFAULT_PHP_VER=53
-IGNORE_WITH_PHP=5
 BUILD_WRKSRC=	${WRKSRC}/php
 INSTALL_WRKSRC=	${WRKSRC}/php
 
@@ -49,6 +47,8 @@
 MAKE_ENV+=	NOPORTDOCS=yes
 .endif
 
+LICENSE=	GPLv2
+
 post-patch:
 	@${REINPLACE_CMD} -e 's|-pthread|${PTHREAD_LIBS}|' ${WRKSRC}/php/config/Make.rules.php
 	${REINPLACE_CMD} 's|%%INSTALL_PROGRAM%%|${INSTALL_PROGRAM}|g; \


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-ports-bugs mailing list