diff options
author | Benoit Foucher <benoit@zeroc.com> | 2018-01-31 17:21:12 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2018-01-31 17:21:12 +0100 |
commit | c3f44e70ea6a8c9bd16281f4b7e2bcd8f7bae47f (patch) | |
tree | a02e199af243136b4dc4a83929e8c9a185c9dcd8 /php/src/php7/Proxy.cpp | |
parent | Updated AutoStart description (diff) | |
download | ice-c3f44e70ea6a8c9bd16281f4b7e2bcd8f7bae47f.tar.bz2 ice-c3f44e70ea6a8c9bd16281f4b7e2bcd8f7bae47f.tar.xz ice-c3f44e70ea6a8c9bd16281f4b7e2bcd8f7bae47f.zip |
Added support for ice_fixed, ice_getTimeout, ice_getCompress methods (ICE-7996 & ICE-7976)
Diffstat (limited to 'php/src/php7/Proxy.cpp')
-rw-r--r-- | php/src/php7/Proxy.cpp | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/php/src/php7/Proxy.cpp b/php/src/php7/Proxy.cpp index 23b6e4d7806..54772d4afe3 100644 --- a/php/src/php7/Proxy.cpp +++ b/php/src/php7/Proxy.cpp @@ -1154,6 +1154,35 @@ ZEND_METHOD(Ice_ObjectPrx, ice_compress) } } +ZEND_METHOD(Ice_ObjectPrx, ice_getCompress) +{ + if(ZEND_NUM_ARGS() != 0) + { + WRONG_PARAM_COUNT; + } + + ProxyPtr _this = Wrapper<ProxyPtr>::value(getThis() TSRMLS_CC); + assert(_this); + + try + { + IceUtil::Optional<bool> 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<ProxyPtr>::value(getThis()); @@ -1179,6 +1208,35 @@ ZEND_METHOD(Ice_ObjectPrx, ice_timeout) } } +ZEND_METHOD(Ice_ObjectPrx, ice_getTimeout) +{ + if(ZEND_NUM_ARGS() != 0) + { + WRONG_PARAM_COUNT; + } + + ProxyPtr _this = Wrapper<ProxyPtr>::value(getThis() TSRMLS_CC); + assert(_this); + + try + { + IceUtil::Optional<int> timeout = _this->proxy->ice_getTimeout(); + if(timeout) + { + ZVAL_LONG(return_value, static_cast<long>(*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<ProxyPtr>::value(getThis()); @@ -1229,6 +1287,38 @@ ZEND_METHOD(Ice_ObjectPrx, ice_connectionId) } } +ZEND_METHOD(Ice_ObjectPrx, ice_fixed) +{ + ProxyPtr _this = Wrapper<ProxyPtr>::value(getThis() TSRMLS_CC); + assert(_this); + + zval* zcon; + if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, const_cast<char*>("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) @@ -1629,9 +1719,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) |