Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 236264 | Differences between
and this patch

Collapse All | Expand All

(-)a/php/src/IcePHP/Communicator.cpp (-3 / +15 lines)
Lines 716-722 handleFreeStorage(void* p TSRMLS_DC) Link Here
716
{
716
{
717
    Wrapper<CommunicatorInfoIPtr>* obj = static_cast<Wrapper<CommunicatorInfoIPtr>*>(p);
717
    Wrapper<CommunicatorInfoIPtr>* obj = static_cast<Wrapper<CommunicatorInfoIPtr>*>(p);
718
    delete obj->ptr;
718
    delete obj->ptr;
719
    zend_objects_free_object_storage(static_cast<zend_object*>(p) TSRMLS_CC);
719
    zend_object_std_dtor(static_cast<zend_object*>(p) TSRMLS_CC);
720
    efree(p);
720
}
721
}
721
722
722
#ifdef _WIN32
723
#ifdef _WIN32
Lines 834-839 ZEND_FUNCTION(Ice_initialize) Link Here
834
835
835
    Ice::StringSeq seq;
836
    Ice::StringSeq seq;
836
    Ice::InitializationData initData;
837
    Ice::InitializationData initData;
838
    zval* zvargs = 0;
837
    zval* zvinit = 0;
839
    zval* zvinit = 0;
838
840
839
    //
841
    //
Lines 853-858 ZEND_FUNCTION(Ice_initialize) Link Here
853
            {
855
            {
854
                RETURN_NULL();
856
                RETURN_NULL();
855
            }
857
            }
858
            zvargs = *args[0];
856
            hasArgs = true;
859
            hasArgs = true;
857
            if(ZEND_NUM_ARGS() > 1)
860
            if(ZEND_NUM_ARGS() > 1)
858
            {
861
            {
Lines 913-918 ZEND_FUNCTION(Ice_initialize) Link Here
913
    {
916
    {
914
        RETURN_NULL();
917
        RETURN_NULL();
915
    }
918
    }
919
920
    if(zvargs && PZVAL_IS_REF(zvargs))
921
    {
922
        zval_dtor(zvargs);
923
        if(!createStringArray(zvargs, seq TSRMLS_CC))
924
        {
925
            RETURN_NULL();
926
        }
927
    }
916
}
928
}
917
929
918
ZEND_FUNCTION(Ice_register)
930
ZEND_FUNCTION(Ice_register)
Lines 1092-1102 ZEND_FUNCTION(Ice_getProperties) Link Here
1092
//
1104
//
1093
// Predefined methods for Communicator.
1105
// Predefined methods for Communicator.
1094
//
1106
//
1095
static function_entry _interfaceMethods[] =
1107
static zend_function_entry _interfaceMethods[] =
1096
{
1108
{
1097
    {0, 0, 0}
1109
    {0, 0, 0}
1098
};
1110
};
1099
static function_entry _classMethods[] =
1111
static zend_function_entry _classMethods[] =
1100
{
1112
{
1101
    ZEND_ME(Ice_Communicator, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
1113
    ZEND_ME(Ice_Communicator, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
1102
    ZEND_ME(Ice_Communicator, destroy, NULL, ZEND_ACC_PUBLIC)
1114
    ZEND_ME(Ice_Communicator, destroy, NULL, ZEND_ACC_PUBLIC)
(-)a/php/src/IcePHP/Communicator.h (-18 lines)
Lines 25-48 ZEND_FUNCTION(Ice_find); Link Here
25
ZEND_FUNCTION(Ice_getProperties);
25
ZEND_FUNCTION(Ice_getProperties);
26
}
26
}
27
27
28
#define ICEPHP_COMMUNICATOR_FUNCTIONS \
29
    ZEND_FE(Ice_initialize, NULL) \
30
    ZEND_FE(Ice_register, NULL) \
31
    ZEND_FE(Ice_unregister, NULL) \
32
    ZEND_FE(Ice_find, NULL) \
33
    ZEND_FE(Ice_getProperties, NULL)
34
35
#ifdef ICEPHP_USE_NAMESPACES
36
#   define ICEPHP_COMMUNICATOR_NS_FUNCTIONS \
37
    ZEND_NS_FALIAS("Ice", initialize, Ice_initialize, NULL) \
38
    ZEND_NS_FALIAS("Ice", register, Ice_register, NULL) \
39
    ZEND_NS_FALIAS("Ice", unregister, Ice_unregister, NULL) \
40
    ZEND_NS_FALIAS("Ice", find, Ice_find, NULL) \
41
    ZEND_NS_FALIAS("Ice", getProperties, Ice_getProperties, NULL)
42
#else
43
#   define ICEPHP_COMMUNICATOR_NS_FUNCTIONS
44
#endif
45
46
namespace IcePHP
28
namespace IcePHP
47
{
29
{
48
30
(-)a/php/src/IcePHP/Connection.cpp (-5 / +7 lines)
Lines 236-242 handleConnectionFreeStorage(void* p TSRMLS_DC) Link Here
236
{
236
{
237
    Wrapper<Ice::ConnectionPtr>* obj = static_cast<Wrapper<Ice::ConnectionPtr>*>(p);
237
    Wrapper<Ice::ConnectionPtr>* obj = static_cast<Wrapper<Ice::ConnectionPtr>*>(p);
238
    delete obj->ptr;
238
    delete obj->ptr;
239
    zend_objects_free_object_storage(static_cast<zend_object*>(p) TSRMLS_CC);
239
    zend_object_std_dtor(static_cast<zend_object*>(p) TSRMLS_CC);
240
    efree(p);
240
}
241
}
241
242
242
#ifdef _WIN32
243
#ifdef _WIN32
Lines 271-281 handleConnectionCompare(zval* zobj1, zval* zobj2 TSRMLS_DC) Link Here
271
//
272
//
272
// Predefined methods for Connection.
273
// Predefined methods for Connection.
273
//
274
//
274
static function_entry _interfaceMethods[] =
275
static zend_function_entry _interfaceMethods[] =
275
{
276
{
276
    {0, 0, 0}
277
    {0, 0, 0}
277
};
278
};
278
static function_entry _connectionClassMethods[] =
279
static zend_function_entry _connectionClassMethods[] =
279
{
280
{
280
    ZEND_ME(Ice_Connection, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
281
    ZEND_ME(Ice_Connection, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
281
    ZEND_ME(Ice_Connection, __toString, NULL, ZEND_ACC_PUBLIC)
282
    ZEND_ME(Ice_Connection, __toString, NULL, ZEND_ACC_PUBLIC)
Lines 297-303 ZEND_METHOD(Ice_ConnectionInfo, __construct) Link Here
297
//
298
//
298
// Predefined methods for ConnectionInfo.
299
// Predefined methods for ConnectionInfo.
299
//
300
//
300
static function_entry _connectionInfoClassMethods[] =
301
static zend_function_entry _connectionInfoClassMethods[] =
301
{
302
{
302
    ZEND_ME(Ice_ConnectionInfo, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
303
    ZEND_ME(Ice_ConnectionInfo, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
303
    {0, 0, 0}
304
    {0, 0, 0}
Lines 329-335 handleConnectionInfoFreeStorage(void* p TSRMLS_DC) Link Here
329
{
330
{
330
    Wrapper<Ice::ConnectionInfoPtr>* obj = static_cast<Wrapper<Ice::ConnectionInfoPtr>*>(p);
331
    Wrapper<Ice::ConnectionInfoPtr>* obj = static_cast<Wrapper<Ice::ConnectionInfoPtr>*>(p);
331
    delete obj->ptr;
332
    delete obj->ptr;
332
    zend_objects_free_object_storage(static_cast<zend_object*>(p) TSRMLS_CC);
333
    zend_object_std_dtor(static_cast<zend_object*>(p) TSRMLS_CC);
334
    efree(p);
333
}
335
}
334
336
335
bool
337
bool
(-)a/php/src/IcePHP/Endpoint.cpp (-5 / +7 lines)
Lines 115-121 handleEndpointFreeStorage(void* p TSRMLS_DC) Link Here
115
{
115
{
116
    Wrapper<Ice::EndpointPtr>* obj = static_cast<Wrapper<Ice::EndpointPtr>*>(p);
116
    Wrapper<Ice::EndpointPtr>* obj = static_cast<Wrapper<Ice::EndpointPtr>*>(p);
117
    delete obj->ptr;
117
    delete obj->ptr;
118
    zend_objects_free_object_storage(static_cast<zend_object*>(p) TSRMLS_CC);
118
    zend_object_std_dtor(static_cast<zend_object*>(p) TSRMLS_CC);
119
    efree(p);
119
}
120
}
120
121
121
ZEND_METHOD(Ice_EndpointInfo, __construct)
122
ZEND_METHOD(Ice_EndpointInfo, __construct)
Lines 213-222 handleEndpointInfoFreeStorage(void* p TSRMLS_DC) Link Here
213
{
214
{
214
    Wrapper<Ice::EndpointInfoPtr>* obj = static_cast<Wrapper<Ice::EndpointInfoPtr>*>(p);
215
    Wrapper<Ice::EndpointInfoPtr>* obj = static_cast<Wrapper<Ice::EndpointInfoPtr>*>(p);
215
    delete obj->ptr;
216
    delete obj->ptr;
216
    zend_objects_free_object_storage(static_cast<zend_object*>(p) TSRMLS_CC);
217
    zend_object_std_dtor(static_cast<zend_object*>(p) TSRMLS_CC);
218
    efree(p);
217
}
219
}
218
220
219
static function_entry _interfaceMethods[] =
221
static zend_function_entry _interfaceMethods[] =
220
{
222
{
221
    {0, 0, 0}
223
    {0, 0, 0}
222
};
224
};
Lines 224-230 static function_entry _interfaceMethods[] = Link Here
224
//
226
//
225
// Predefined methods for Endpoint.
227
// Predefined methods for Endpoint.
226
//
228
//
227
static function_entry _endpointMethods[] =
229
static zend_function_entry _endpointMethods[] =
228
{
230
{
229
    ZEND_ME(Ice_Endpoint, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
231
    ZEND_ME(Ice_Endpoint, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
230
    ZEND_ME(Ice_Endpoint, __toString, NULL, ZEND_ACC_PUBLIC)
232
    ZEND_ME(Ice_Endpoint, __toString, NULL, ZEND_ACC_PUBLIC)
Lines 236-242 static function_entry _endpointMethods[] = Link Here
236
//
238
//
237
// Predefined methods for EndpointInfo.
239
// Predefined methods for EndpointInfo.
238
//
240
//
239
static function_entry _endpointInfoMethods[] =
241
static zend_function_entry _endpointInfoMethods[] =
240
{
242
{
241
    ZEND_ME(Ice_EndpointInfo, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
243
    ZEND_ME(Ice_EndpointInfo, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
242
    ZEND_ME(Ice_EndpointInfo, type, NULL, ZEND_ACC_PUBLIC)
244
    ZEND_ME(Ice_EndpointInfo, type, NULL, ZEND_ACC_PUBLIC)
(-)a/php/src/IcePHP/Init.cpp (-1 / +64 lines)
Lines 22-31 using namespace IcePHP; Link Here
22
22
23
ZEND_DECLARE_MODULE_GLOBALS(ice)
23
ZEND_DECLARE_MODULE_GLOBALS(ice)
24
24
25
ZEND_BEGIN_ARG_INFO(Ice_initialize_arginfo, 1)
26
ZEND_END_ARG_INFO()
27
28
ZEND_BEGIN_ARG_INFO(Ice_createProperties_arginfo, 1)
29
ZEND_END_ARG_INFO()
30
31
#define ICEPHP_COMMUNICATOR_FUNCTIONS \
32
    ZEND_FE(Ice_initialize, Ice_initialize_arginfo) \
33
    ZEND_FE(Ice_register, NULL) \
34
    ZEND_FE(Ice_unregister, NULL) \
35
    ZEND_FE(Ice_find, NULL) \
36
    ZEND_FE(Ice_getProperties, NULL)
37
38
#ifdef ICEPHP_USE_NAMESPACES
39
#   define ICEPHP_COMMUNICATOR_NS_FUNCTIONS \
40
    ZEND_NS_FALIAS("Ice", initialize, Ice_initialize, Ice_initialize_arginfo) \
41
    ZEND_NS_FALIAS("Ice", register, Ice_register, NULL) \
42
    ZEND_NS_FALIAS("Ice", unregister, Ice_unregister, NULL) \
43
    ZEND_NS_FALIAS("Ice", find, Ice_find, NULL) \
44
    ZEND_NS_FALIAS("Ice", getProperties, Ice_getProperties, NULL)
45
#else
46
#   define ICEPHP_COMMUNICATOR_NS_FUNCTIONS
47
#endif
48
49
#define ICEPHP_OPERATION_FUNCTIONS \
50
    ZEND_FE(IcePHP_defineOperation,  NULL)
51
52
#define ICEPHP_PROPERTIES_FUNCTIONS \
53
    ZEND_FE(Ice_createProperties, Ice_createProperties_arginfo)
54
55
#ifdef ICEPHP_USE_NAMESPACES
56
#   define ICEPHP_PROPERTIES_NS_FUNCTIONS \
57
    ZEND_NS_FALIAS("Ice", createProperties, Ice_createProperties, Ice_createProperties_arginfo)
58
#else
59
#   define ICEPHP_PROPERTIES_NS_FUNCTIONS
60
#endif
61
62
#define ICEPHP_TYPE_FUNCTIONS \
63
    ZEND_FE(IcePHP_defineEnum,          NULL) \
64
    ZEND_FE(IcePHP_defineStruct,        NULL) \
65
    ZEND_FE(IcePHP_defineSequence,      NULL) \
66
    ZEND_FE(IcePHP_defineDictionary,    NULL) \
67
    ZEND_FE(IcePHP_defineProxy,         NULL) \
68
    ZEND_FE(IcePHP_declareClass,        NULL) \
69
    ZEND_FE(IcePHP_defineClass,         NULL) \
70
    ZEND_FE(IcePHP_defineException,     NULL) \
71
    ZEND_FE(IcePHP_stringify,           NULL) \
72
    ZEND_FE(IcePHP_stringifyException,  NULL)
73
74
#define ICEPHP_UTIL_FUNCTIONS \
75
    ZEND_FE(Ice_stringVersion, NULL) \
76
    ZEND_FE(Ice_intVersion, NULL) \
77
    ZEND_FE(Ice_generateUUID, NULL)
78
79
#ifdef ICEPHP_USE_NAMESPACES
80
#   define ICEPHP_UTIL_NS_FUNCTIONS \
81
    ZEND_NS_FALIAS("Ice", stringVersion, Ice_stringVersion, NULL) \
82
    ZEND_NS_FALIAS("Ice", intVersion, Ice_intVersion, NULL) \
83
    ZEND_NS_FALIAS("Ice", generateUUID, Ice_generateUUID, NULL)
84
#else
85
#   define ICEPHP_UTIL_NS_FUNCTIONS
86
#endif
87
25
//
88
//
26
// Entries for all global functions.
89
// Entries for all global functions.
27
//
90
//
28
function_entry ice_functions[] =
91
zend_function_entry ice_functions[] =
29
{
92
{
30
    ICEPHP_COMMUNICATOR_FUNCTIONS
93
    ICEPHP_COMMUNICATOR_FUNCTIONS
31
    ICEPHP_COMMUNICATOR_NS_FUNCTIONS
94
    ICEPHP_COMMUNICATOR_NS_FUNCTIONS
(-)a/php/src/IcePHP/Logger.cpp (-3 / +4 lines)
Lines 210-216 handleFreeStorage(void* p TSRMLS_DC) Link Here
210
{
210
{
211
    Wrapper<Ice::LoggerPtr>* obj = static_cast<Wrapper<Ice::LoggerPtr>*>(p);
211
    Wrapper<Ice::LoggerPtr>* obj = static_cast<Wrapper<Ice::LoggerPtr>*>(p);
212
    delete obj->ptr;
212
    delete obj->ptr;
213
    zend_objects_free_object_storage(static_cast<zend_object*>(p) TSRMLS_CC);
213
    zend_object_std_dtor(static_cast<zend_object*>(p) TSRMLS_CC);
214
    efree(p);
214
}
215
}
215
216
216
#ifdef _WIN32
217
#ifdef _WIN32
Lines 226-236 handleClone(zval* zv TSRMLS_DC) Link Here
226
//
227
//
227
// Predefined methods for Logger.
228
// Predefined methods for Logger.
228
//
229
//
229
static function_entry _interfaceMethods[] =
230
static zend_function_entry _interfaceMethods[] =
230
{
231
{
231
    {0, 0, 0}
232
    {0, 0, 0}
232
};
233
};
233
static function_entry _classMethods[] =
234
static zend_function_entry _classMethods[] =
234
{
235
{
235
    ZEND_ME(Ice_Logger, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
236
    ZEND_ME(Ice_Logger, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
236
    ZEND_ME(Ice_Logger, __toString, NULL, ZEND_ACC_PUBLIC)
237
    ZEND_ME(Ice_Logger, __toString, NULL, ZEND_ACC_PUBLIC)
(-)a/php/src/IcePHP/Operation.cpp (-10 / +17 lines)
Lines 218-224 IcePHP::OperationI::~OperationI() Link Here
218
    if(_zendFunction)
218
    if(_zendFunction)
219
    {
219
    {
220
        delete []_zendFunction->arg_info;
220
        delete []_zendFunction->arg_info;
221
        efree(_zendFunction->function_name);
221
        efree(const_cast<char*>(_zendFunction->function_name));
222
        efree(_zendFunction);
222
        efree(_zendFunction);
223
    }
223
    }
224
}
224
}
Lines 238-249 IcePHP::OperationI::function() Link Here
238
        for(p = inParams.begin(); p != inParams.end(); ++p, ++i)
238
        for(p = inParams.begin(); p != inParams.end(); ++p, ++i)
239
        {
239
        {
240
            getArgInfo(argInfo[i], *p, false);
240
            getArgInfo(argInfo[i], *p, false);
241
#if PHP_VERSION_ID < 50400
241
            argInfo[i].required_num_args = static_cast<zend_uint>(numParams);
242
            argInfo[i].required_num_args = static_cast<zend_uint>(numParams);
243
#endif
242
        }
244
        }
243
        for(p = outParams.begin(); p != outParams.end(); ++p, ++i)
245
        for(p = outParams.begin(); p != outParams.end(); ++p, ++i)
244
        {
246
        {
245
            getArgInfo(argInfo[i], *p, true);
247
            getArgInfo(argInfo[i], *p, true);
248
#if PHP_VERSION_ID < 50400
246
            argInfo[i].required_num_args = static_cast<zend_uint>(numParams);
249
            argInfo[i].required_num_args = static_cast<zend_uint>(numParams);
250
#endif
247
        }
251
        }
248
252
249
        string fixed = fixIdent(name);
253
        string fixed = fixIdent(name);
Lines 255-263 IcePHP::OperationI::function() Link Here
255
        _zendFunction->prototype = 0;
259
        _zendFunction->prototype = 0;
256
        _zendFunction->num_args = static_cast<zend_uint>(numParams);
260
        _zendFunction->num_args = static_cast<zend_uint>(numParams);
257
        _zendFunction->arg_info = argInfo;
261
        _zendFunction->arg_info = argInfo;
258
        _zendFunction->pass_rest_by_reference = 0;
259
        _zendFunction->required_num_args = _zendFunction->num_args;
262
        _zendFunction->required_num_args = _zendFunction->num_args;
263
#if PHP_VERSION_ID < 50400
264
        _zendFunction->pass_rest_by_reference = 0;
260
        _zendFunction->return_reference = 0;
265
        _zendFunction->return_reference = 0;
266
#endif
261
        _zendFunction->handler = ZEND_FN(IcePHP_Operation_call);
267
        _zendFunction->handler = ZEND_FN(IcePHP_Operation_call);
262
    }
268
    }
263
269
Lines 293-307 IcePHP::OperationI::getArgInfo(zend_arg_info& arg, const TypeInfoPtr& info, bool Link Here
293
    arg.name = 0;
299
    arg.name = 0;
294
    arg.class_name = 0;
300
    arg.class_name = 0;
295
    arg.allow_null = 1;
301
    arg.allow_null = 1;
296
    if(SequenceInfoPtr::dynamicCast(info) || DictionaryInfoPtr::dynamicCast(info))
302
297
    {
303
    const bool isArray = SequenceInfoPtr::dynamicCast(info) || DictionaryInfoPtr::dynamicCast(info);
298
        arg.array_type_hint = 1;
304
299
    }
305
#if PHP_VERSION_ID < 50400
300
    else
306
    arg.array_type_hint = isArray ? 1 : 0;
301
    {
302
        arg.array_type_hint = 0;
303
    }
304
    arg.return_reference = 0;
307
    arg.return_reference = 0;
308
#else
309
    arg.type_hint = isArray ? IS_ARRAY : 0;
310
#endif
311
305
    arg.pass_by_reference = out ? 1 : 0;
312
    arg.pass_by_reference = out ? 1 : 0;
306
}
313
}
307
314
(-)a/php/src/IcePHP/Operation.h (-3 lines)
Lines 20-28 extern "C" Link Here
20
ZEND_FUNCTION(IcePHP_defineOperation);
20
ZEND_FUNCTION(IcePHP_defineOperation);
21
}
21
}
22
22
23
#define ICEPHP_OPERATION_FUNCTIONS \
24
    ZEND_FE(IcePHP_defineOperation,  NULL)
25
26
namespace IcePHP
23
namespace IcePHP
27
{
24
{
28
25
(-)a/php/src/IcePHP/Properties.cpp (-3 / +4 lines)
Lines 493-499 handleFreeStorage(void* p TSRMLS_DC) Link Here
493
{
493
{
494
    Wrapper<Ice::PropertiesPtr>* obj = static_cast<Wrapper<Ice::PropertiesPtr>*>(p);
494
    Wrapper<Ice::PropertiesPtr>* obj = static_cast<Wrapper<Ice::PropertiesPtr>*>(p);
495
    delete obj->ptr;
495
    delete obj->ptr;
496
    zend_objects_free_object_storage(static_cast<zend_object*>(p) TSRMLS_CC);
496
    zend_object_std_dtor(static_cast<zend_object*>(p) TSRMLS_CC);
497
    efree(p);
497
}
498
}
498
499
499
#ifdef _WIN32
500
#ifdef _WIN32
Lines 589-599 ZEND_FUNCTION(Ice_createProperties) Link Here
589
//
590
//
590
// Predefined methods for Properties.
591
// Predefined methods for Properties.
591
//
592
//
592
static function_entry _interfaceMethods[] =
593
static zend_function_entry _interfaceMethods[] =
593
{
594
{
594
    {0, 0, 0}
595
    {0, 0, 0}
595
};
596
};
596
static function_entry _classMethods[] =
597
static zend_function_entry _classMethods[] =
597
{
598
{
598
    ZEND_ME(Ice_Properties, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
599
    ZEND_ME(Ice_Properties, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
599
    ZEND_ME(Ice_Properties, __toString, NULL, ZEND_ACC_PUBLIC)
600
    ZEND_ME(Ice_Properties, __toString, NULL, ZEND_ACC_PUBLIC)
(-)a/php/src/IcePHP/Properties.h (-10 lines)
Lines 20-35 extern "C" Link Here
20
ZEND_FUNCTION(Ice_createProperties);
20
ZEND_FUNCTION(Ice_createProperties);
21
}
21
}
22
22
23
#define ICEPHP_PROPERTIES_FUNCTIONS \
24
    ZEND_FE(Ice_createProperties, NULL)
25
26
#ifdef ICEPHP_USE_NAMESPACES
27
#   define ICEPHP_PROPERTIES_NS_FUNCTIONS \
28
    ZEND_NS_FALIAS("Ice", createProperties, Ice_createProperties, NULL)
29
#else
30
#   define ICEPHP_PROPERTIES_NS_FUNCTIONS
31
#endif
32
33
namespace IcePHP
23
namespace IcePHP
34
{
24
{
35
25
(-)a/php/src/IcePHP/Proxy.cpp (-2 / +15 lines)
Lines 59-65 extern "C" Link Here
59
static zend_object_value handleAlloc(zend_class_entry* TSRMLS_DC);
59
static zend_object_value handleAlloc(zend_class_entry* TSRMLS_DC);
60
static void handleFreeStorage(void* TSRMLS_DC);
60
static void handleFreeStorage(void* TSRMLS_DC);
61
static zend_object_value handleClone(zval* TSRMLS_DC);
61
static zend_object_value handleClone(zval* TSRMLS_DC);
62
#if PHP_VERSION_ID < 50400
62
static union _zend_function* handleGetMethod(zval**, char*, int TSRMLS_DC);
63
static union _zend_function* handleGetMethod(zval**, char*, int TSRMLS_DC);
64
#else
65
static union _zend_function* handleGetMethod(zval**, char*, int, const _zend_literal* TSRMLS_DC);
66
#endif
63
static int handleCompare(zval*, zval* TSRMLS_DC);
67
static int handleCompare(zval*, zval* TSRMLS_DC);
64
}
68
}
65
69
Lines 1418-1424 handleFreeStorage(void* p TSRMLS_DC) Link Here
1418
{
1422
{
1419
    Wrapper<ProxyPtr>* obj = static_cast<Wrapper<ProxyPtr>*>(p);
1423
    Wrapper<ProxyPtr>* obj = static_cast<Wrapper<ProxyPtr>*>(p);
1420
    delete obj->ptr;
1424
    delete obj->ptr;
1421
    zend_objects_free_object_storage(static_cast<zend_object*>(p) TSRMLS_CC);
1425
    zend_object_std_dtor(static_cast<zend_object*>(p) TSRMLS_CC);
1426
    efree(p);
1422
}
1427
}
1423
1428
1424
#ifdef _WIN32
1429
#ifdef _WIN32
Lines 1461-1467 handleClone(zval* zv TSRMLS_DC) Link Here
1461
extern "C"
1466
extern "C"
1462
#endif
1467
#endif
1463
static union _zend_function*
1468
static union _zend_function*
1469
#if PHP_VERSION_ID < 50400
1464
handleGetMethod(zval** zv, char* method, int len TSRMLS_DC)
1470
handleGetMethod(zval** zv, char* method, int len TSRMLS_DC)
1471
#else
1472
handleGetMethod(zval** zv, char* method, int len, const _zend_literal* key TSRMLS_DC)
1473
#endif
1465
{
1474
{
1466
    zend_function* result;
1475
    zend_function* result;
1467
1476
Lines 1470-1476 handleGetMethod(zval** zv, char* method, int len TSRMLS_DC) Link Here
1470
    // any of our predefined proxy methods. If it returns 0, then we return a
1479
    // any of our predefined proxy methods. If it returns 0, then we return a
1471
    // function that will check the class definition.
1480
    // function that will check the class definition.
1472
    //
1481
    //
1482
#if PHP_VERSION_ID < 50400
1473
    result = zend_get_std_object_handlers()->get_method(zv, method, len TSRMLS_CC);
1483
    result = zend_get_std_object_handlers()->get_method(zv, method, len TSRMLS_CC);
1484
#else
1485
    result = zend_get_std_object_handlers()->get_method(zv, method, len, key TSRMLS_CC);
1486
#endif
1474
    if(!result)
1487
    if(!result)
1475
    {
1488
    {
1476
        Wrapper<ProxyPtr>* obj = Wrapper<ProxyPtr>::extract(*zv TSRMLS_CC);
1489
        Wrapper<ProxyPtr>* obj = Wrapper<ProxyPtr>::extract(*zv TSRMLS_CC);
Lines 1532-1538 handleCompare(zval* zobj1, zval* zobj2 TSRMLS_DC) Link Here
1532
//
1545
//
1533
// Predefined methods for ObjectPrx.
1546
// Predefined methods for ObjectPrx.
1534
//
1547
//
1535
static function_entry _proxyMethods[] =
1548
static zend_function_entry _proxyMethods[] =
1536
{
1549
{
1537
    ZEND_ME(Ice_ObjectPrx, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
1550
    ZEND_ME(Ice_ObjectPrx, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
1538
    ZEND_ME(Ice_ObjectPrx, __toString, NULL, ZEND_ACC_PUBLIC)
1551
    ZEND_ME(Ice_ObjectPrx, __toString, NULL, ZEND_ACC_PUBLIC)
(-)a/php/src/IcePHP/Types.cpp (-4 / +6 lines)
Lines 2405-2411 handleTypeInfoFreeStorage(void* p TSRMLS_DC) Link Here
2405
{
2405
{
2406
    Wrapper<TypeInfoPtr>* obj = static_cast<Wrapper<TypeInfoPtr>*>(p);
2406
    Wrapper<TypeInfoPtr>* obj = static_cast<Wrapper<TypeInfoPtr>*>(p);
2407
    delete obj->ptr;
2407
    delete obj->ptr;
2408
    zend_objects_free_object_storage(static_cast<zend_object*>(p) TSRMLS_CC);
2408
    zend_object_std_dtor(static_cast<zend_object*>(p) TSRMLS_CC);
2409
    efree(p);
2409
}
2410
}
2410
2411
2411
static bool
2412
static bool
Lines 2718-2724 handleExceptionInfoFreeStorage(void* p TSRMLS_DC) Link Here
2718
{
2719
{
2719
    Wrapper<ExceptionInfoPtr>* obj = static_cast<Wrapper<ExceptionInfoPtr>*>(p);
2720
    Wrapper<ExceptionInfoPtr>* obj = static_cast<Wrapper<ExceptionInfoPtr>*>(p);
2720
    delete obj->ptr;
2721
    delete obj->ptr;
2721
    zend_objects_free_object_storage(static_cast<zend_object*>(p) TSRMLS_CC);
2722
    zend_object_std_dtor(static_cast<zend_object*>(p) TSRMLS_CC);
2723
    efree(p);
2722
}
2724
}
2723
2725
2724
2726
Lines 2853-2859 ZEND_FUNCTION(IcePHP_stringifyException) Link Here
2853
//
2855
//
2854
// Predefined methods for IcePHP_TypeInfo.
2856
// Predefined methods for IcePHP_TypeInfo.
2855
//
2857
//
2856
static function_entry _typeInfoMethods[] =
2858
static zend_function_entry _typeInfoMethods[] =
2857
{
2859
{
2858
    {0, 0, 0}
2860
    {0, 0, 0}
2859
};
2861
};
Lines 2861-2867 static function_entry _typeInfoMethods[] = Link Here
2861
//
2863
//
2862
// Predefined methods for IcePHP_ExceptionInfo.
2864
// Predefined methods for IcePHP_ExceptionInfo.
2863
//
2865
//
2864
static function_entry _exceptionInfoMethods[] =
2866
static zend_function_entry _exceptionInfoMethods[] =
2865
{
2867
{
2866
    {0, 0, 0}
2868
    {0, 0, 0}
2867
};
2869
};
(-)a/php/src/IcePHP/Types.h (-12 lines)
Lines 33-50 ZEND_FUNCTION(IcePHP_stringify); Link Here
33
ZEND_FUNCTION(IcePHP_stringifyException);
33
ZEND_FUNCTION(IcePHP_stringifyException);
34
}
34
}
35
35
36
#define ICEPHP_TYPE_FUNCTIONS \
37
    ZEND_FE(IcePHP_defineEnum,          NULL) \
38
    ZEND_FE(IcePHP_defineStruct,        NULL) \
39
    ZEND_FE(IcePHP_defineSequence,      NULL) \
40
    ZEND_FE(IcePHP_defineDictionary,    NULL) \
41
    ZEND_FE(IcePHP_defineProxy,         NULL) \
42
    ZEND_FE(IcePHP_declareClass,        NULL) \
43
    ZEND_FE(IcePHP_defineClass,         NULL) \
44
    ZEND_FE(IcePHP_defineException,     NULL) \
45
    ZEND_FE(IcePHP_stringify,           NULL) \
46
    ZEND_FE(IcePHP_stringifyException,  NULL)
47
48
namespace IcePHP
36
namespace IcePHP
49
{
37
{
50
38
(-)a/php/src/IcePHP/Util.cpp (-3 / +9 lines)
Lines 17-22 using namespace std; Link Here
17
using namespace IcePHP;
17
using namespace IcePHP;
18
using namespace Slice::PHP;
18
using namespace Slice::PHP;
19
19
20
#if PHP_VERSION_ID < 50400
20
#ifdef _WIN32
21
#ifdef _WIN32
21
extern "C"
22
extern "C"
22
#endif
23
#endif
Lines 25-44 dtor_wrapper(void* p) Link Here
25
{
26
{
26
    zval_ptr_dtor(static_cast<zval**>(p));
27
    zval_ptr_dtor(static_cast<zval**>(p));
27
}
28
}
29
#endif
28
30
29
void*
31
void*
30
IcePHP::createWrapper(zend_class_entry* ce, size_t sz TSRMLS_DC)
32
IcePHP::createWrapper(zend_class_entry* ce, size_t sz TSRMLS_DC)
31
{
33
{
32
    zend_object* obj;
34
    zend_object* obj;
33
    zval* tmp;
34
35
35
    obj = static_cast<zend_object*>(emalloc(sz));
36
    obj = static_cast<zend_object*>(emalloc(sz));
36
    obj->ce = ce;
37
    obj->guards = 0;
38
37
38
    zend_object_std_init(obj, ce TSRMLS_CC);
39
40
#if PHP_VERSION_ID < 50400
41
    zval* tmp;
39
    obj->properties = static_cast<HashTable*>(emalloc(sizeof(HashTable)));
42
    obj->properties = static_cast<HashTable*>(emalloc(sizeof(HashTable)));
40
    zend_hash_init(obj->properties, 0, 0, dtor_wrapper, 0);
43
    zend_hash_init(obj->properties, 0, 0, dtor_wrapper, 0);
41
    zend_hash_copy(obj->properties, &ce->default_properties, (copy_ctor_func_t)zval_add_ref, &tmp, sizeof(zval*));
44
    zend_hash_copy(obj->properties, &ce->default_properties, (copy_ctor_func_t)zval_add_ref, &tmp, sizeof(zval*));
45
#else
46
    object_properties_init(obj, ce);
47
#endif
42
48
43
    return obj;
49
    return obj;
44
}
50
}
(-)a/php/src/IcePHP/Util.h (-14 lines)
Lines 22-41 ZEND_FUNCTION(Ice_intVersion); Link Here
22
ZEND_FUNCTION(Ice_generateUUID);
22
ZEND_FUNCTION(Ice_generateUUID);
23
}
23
}
24
24
25
#define ICEPHP_UTIL_FUNCTIONS \
26
    ZEND_FE(Ice_stringVersion, NULL) \
27
    ZEND_FE(Ice_intVersion, NULL) \
28
    ZEND_FE(Ice_generateUUID, NULL)
29
30
#ifdef ICEPHP_USE_NAMESPACES
31
#   define ICEPHP_UTIL_NS_FUNCTIONS \
32
    ZEND_NS_FALIAS("Ice", stringVersion, Ice_stringVersion, NULL) \
33
    ZEND_NS_FALIAS("Ice", intVersion, Ice_intVersion, NULL) \
34
    ZEND_NS_FALIAS("Ice", generateUUID, Ice_generateUUID, NULL)
35
#else
36
#   define ICEPHP_UTIL_NS_FUNCTIONS
37
#endif
38
39
namespace IcePHP
25
namespace IcePHP
40
{
26
{
41
27
(-)a/php/test/Ice/binding/Client.php (-1 / +1 lines)
Lines 525-531 function allTests($communicator) Link Here
525
    $com->shutdown();
525
    $com->shutdown();
526
}
526
}
527
527
528
$communicator = Ice_initialize(&$argv);
528
$communicator = Ice_initialize($argv);
529
allTests($communicator);
529
allTests($communicator);
530
$communicator->destroy();
530
$communicator->destroy();
531
exit();
531
exit();
(-)a/php/test/Ice/checksum/Client.php (-1 / +1 lines)
Lines 88-94 function allTests($communicator) Link Here
88
    return $checksum;
88
    return $checksum;
89
}
89
}
90
90
91
$communicator = Ice_initialize(&$argv);
91
$communicator = Ice_initialize($argv);
92
$checksum = allTests($communicator);
92
$checksum = allTests($communicator);
93
$checksum->shutdown();
93
$checksum->shutdown();
94
$communicator->destroy();
94
$communicator->destroy();
(-)a/php/test/Ice/exceptions/Client.php (-1 / +1 lines)
Lines 378-384 function allTests($communicator) Link Here
378
    return $thrower;
378
    return $thrower;
379
}
379
}
380
380
381
$communicator = Ice_initialize(&$argv);
381
$communicator = Ice_initialize($argv);
382
$thrower = allTests($communicator);
382
$thrower = allTests($communicator);
383
$thrower->shutdown();
383
$thrower->shutdown();
384
$communicator->destroy();
384
$communicator->destroy();
(-)a/php/test/Ice/facets/Client.php (-1 / +1 lines)
Lines 89-95 function allTests($communicator) Link Here
89
    return $gf;
89
    return $gf;
90
}
90
}
91
91
92
$communicator = Ice_initialize(&$argv);
92
$communicator = Ice_initialize($argv);
93
$g = allTests($communicator);
93
$g = allTests($communicator);
94
$g->shutdown();
94
$g->shutdown();
95
$communicator->destroy();
95
$communicator->destroy();
(-)a/php/test/Ice/info/Client.php (-1 / +1 lines)
Lines 129-135 function allTests($communicator) Link Here
129
    return $testIntf;
129
    return $testIntf;
130
}
130
}
131
131
132
$communicator = Ice_initialize(&$argv);
132
$communicator = Ice_initialize($argv);
133
$server = allTests($communicator);
133
$server = allTests($communicator);
134
$server->shutdown();
134
$server->shutdown();
135
$communicator->destroy();
135
$communicator->destroy();
(-)a/php/test/Ice/inheritance/Client.php (-1 / +1 lines)
Lines 236-242 function allTests($communicator) Link Here
236
    return $initial;
236
    return $initial;
237
}
237
}
238
238
239
$communicator = Ice_initialize(&$argv);
239
$communicator = Ice_initialize($argv);
240
$initial = allTests($communicator);
240
$initial = allTests($communicator);
241
$initial->shutdown();
241
$initial->shutdown();
242
$communicator->destroy();
242
$communicator->destroy();
(-)a/php/test/Ice/objects/Client.php (-1 / +1 lines)
Lines 391-397 function allTests($communicator) Link Here
391
    return $initial;
391
    return $initial;
392
}
392
}
393
393
394
$communicator = Ice_initialize(&$argv);
394
$communicator = Ice_initialize($argv);
395
$factory = new MyObjectFactory();
395
$factory = new MyObjectFactory();
396
$communicator->addObjectFactory($factory, "::Test::B");
396
$communicator->addObjectFactory($factory, "::Test::B");
397
$communicator->addObjectFactory($factory, "::Test::C");
397
$communicator->addObjectFactory($factory, "::Test::C");
(-)a/php/test/Ice/operations/Client.php (-1 / +1 lines)
Lines 484-490 function allTests($communicator) Link Here
484
    return $cl;
484
    return $cl;
485
}
485
}
486
486
487
$communicator = Ice_initialize(&$argv);
487
$communicator = Ice_initialize($argv);
488
488
489
$myClass = allTests($communicator);
489
$myClass = allTests($communicator);
490
490
(-)a/php/test/Ice/proxy/Client.php (-1 / +1 lines)
Lines 722-728 function allTests($communicator) Link Here
722
    return $cl;
722
    return $cl;
723
}
723
}
724
724
725
$communicator = Ice_initialize(&$argv);
725
$communicator = Ice_initialize($argv);
726
$myClass = allTests($communicator);
726
$myClass = allTests($communicator);
727
$myClass->shutdown();
727
$myClass->shutdown();
728
$communicator->destroy();
728
$communicator->destroy();
(-)a/php/test/Ice/slicing/exceptions/Client.php (-1 / +1 lines)
Lines 315-321 function allTests($communicator) Link Here
315
    return $test;
315
    return $test;
316
}
316
}
317
317
318
$communicator = Ice_initialize(&$argv);
318
$communicator = Ice_initialize($argv);
319
$test = allTests($communicator);
319
$test = allTests($communicator);
320
$test->shutdown();
320
$test->shutdown();
321
$communicator->destroy();
321
$communicator->destroy();
(-)a/php/test/Ice/slicing/objects/Client.php (-1 / +1 lines)
Lines 830-836 function allTests($communicator) Link Here
830
    return $test;
830
    return $test;
831
}
831
}
832
832
833
$communicator = Ice_initialize(&$argv);
833
$communicator = Ice_initialize($argv);
834
$test = allTests($communicator);
834
$test = allTests($communicator);
835
$test->shutdown();
835
$test->shutdown();
836
$communicator->destroy();
836
$communicator->destroy();
(-)a/php/test/Slice/keyword/Client.php (-1 / +1 lines)
Lines 96-102 function allTests($communicator) Link Here
96
    echo "ok\n";
96
    echo "ok\n";
97
}
97
}
98
98
99
$communicator = Ice_initialize(&$argv);
99
$communicator = Ice_initialize($argv);
100
allTests($communicator);
100
allTests($communicator);
101
$communicator->destroy();
101
$communicator->destroy();
102
102
(-)a/php/test/Slice/structure/Client.php (-1 / +1 lines)
Lines 225-231 function allTests($communicator) Link Here
225
    echo "ok\n";
225
    echo "ok\n";
226
}
226
}
227
227
228
$communicator = Ice_initialize(&$argv);
228
$communicator = Ice_initialize($argv);
229
allTests($communicator);
229
allTests($communicator);
230
$communicator->destroy();
230
$communicator->destroy();
231
231

Return to bug 236264