From c3f44e70ea6a8c9bd16281f4b7e2bcd8f7bae47f Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Wed, 31 Jan 2018 17:21:12 +0100 Subject: Added support for ice_fixed, ice_getTimeout, ice_getCompress methods (ICE-7996 & ICE-7976) --- php/src/php5/Proxy.cpp | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) (limited to 'php/src/php5/Proxy.cpp') diff --git a/php/src/php5/Proxy.cpp b/php/src/php5/Proxy.cpp index 5ba77e7e8e1..4758dd3db12 100644 --- a/php/src/php5/Proxy.cpp +++ b/php/src/php5/Proxy.cpp @@ -1167,6 +1167,35 @@ ZEND_METHOD(Ice_ObjectPrx, ice_compress) } } +ZEND_METHOD(Ice_ObjectPrx, ice_getCompress) +{ + if(ZEND_NUM_ARGS() != 0) + { + WRONG_PARAM_COUNT; + } + + ProxyPtr _this = Wrapper::value(getThis() TSRMLS_CC); + assert(_this); + + try + { + IceUtil::Optional compress = _this->proxy->ice_getCompress(); + if(compress) + { + RETURN_BOOL(*compress ? 1 : 0); + } + else + { + assignUnset(return_value TSRMLS_CC); + } + } + catch(const IceUtil::Exception& ex) + { + throwException(ex TSRMLS_CC); + RETURN_NULL(); + } +} + ZEND_METHOD(Ice_ObjectPrx, ice_timeout) { ProxyPtr _this = Wrapper::value(getThis() TSRMLS_CC); @@ -1192,6 +1221,35 @@ ZEND_METHOD(Ice_ObjectPrx, ice_timeout) } } +ZEND_METHOD(Ice_ObjectPrx, ice_getTimeout) +{ + if(ZEND_NUM_ARGS() != 0) + { + WRONG_PARAM_COUNT; + } + + ProxyPtr _this = Wrapper::value(getThis() TSRMLS_CC); + assert(_this); + + try + { + IceUtil::Optional timeout = _this->proxy->ice_getTimeout(); + if(timeout) + { + ZVAL_LONG(return_value, static_cast(*timeout)); + } + else + { + assignUnset(return_value TSRMLS_CC); + } + } + catch(const IceUtil::Exception& ex) + { + throwException(ex TSRMLS_CC); + RETURN_NULL(); + } +} + ZEND_METHOD(Ice_ObjectPrx, ice_invocationTimeout) { ProxyPtr _this = Wrapper::value(getThis() TSRMLS_CC); @@ -1242,6 +1300,38 @@ ZEND_METHOD(Ice_ObjectPrx, ice_connectionId) } } +ZEND_METHOD(Ice_ObjectPrx, ice_fixed) +{ + ProxyPtr _this = Wrapper::value(getThis() TSRMLS_CC); + assert(_this); + + zval* zcon; + if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, const_cast("O!"), &zcon, connectionClassEntry TSRMLS_CC) != + SUCCESS) + { + RETURN_NULL(); + } + + Ice::ConnectionPtr connection; + if(zcon && !fetchConnection(zcon, connection TSRMLS_CC)) + { + RETURN_NULL(); + } + + try + { + if(!_this->clone(return_value, _this->proxy->ice_fixed(connection) TSRMLS_CC)) + { + RETURN_NULL(); + } + } + catch(const IceUtil::Exception& ex) + { + throwException(ex TSRMLS_CC); + RETURN_NULL(); + } +} + ZEND_METHOD(Ice_ObjectPrx, ice_getConnection) { if(ZEND_NUM_ARGS() != 0) @@ -1676,9 +1766,12 @@ static zend_function_entry _proxyMethods[] = ZEND_ME(Ice_ObjectPrx, ice_batchDatagram, ICE_NULLPTR, ZEND_ACC_PUBLIC) ZEND_ME(Ice_ObjectPrx, ice_isBatchDatagram, ICE_NULLPTR, ZEND_ACC_PUBLIC) ZEND_ME(Ice_ObjectPrx, ice_compress, ICE_NULLPTR, ZEND_ACC_PUBLIC) + ZEND_ME(Ice_ObjectPrx, ice_getCompress, ICE_NULLPTR, ZEND_ACC_PUBLIC) ZEND_ME(Ice_ObjectPrx, ice_timeout, ICE_NULLPTR, ZEND_ACC_PUBLIC) + ZEND_ME(Ice_ObjectPrx, ice_getTimeout, ICE_NULLPTR, ZEND_ACC_PUBLIC) ZEND_ME(Ice_ObjectPrx, ice_invocationTimeout, ICE_NULLPTR, ZEND_ACC_PUBLIC) ZEND_ME(Ice_ObjectPrx, ice_connectionId, ICE_NULLPTR, ZEND_ACC_PUBLIC) + ZEND_ME(Ice_ObjectPrx, ice_fixed, ICE_NULLPTR, ZEND_ACC_PUBLIC) ZEND_ME(Ice_ObjectPrx, ice_getConnection, ICE_NULLPTR, ZEND_ACC_PUBLIC) ZEND_ME(Ice_ObjectPrx, ice_getCachedConnection, ICE_NULLPTR, ZEND_ACC_PUBLIC) ZEND_ME(Ice_ObjectPrx, ice_flushBatchRequests, ICE_NULLPTR, ZEND_ACC_PUBLIC) -- cgit v1.2.3