summaryrefslogtreecommitdiff
path: root/php/src/php5
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2018-01-31 17:21:12 +0100
committerBenoit Foucher <benoit@zeroc.com>2018-01-31 17:21:12 +0100
commitc3f44e70ea6a8c9bd16281f4b7e2bcd8f7bae47f (patch)
treea02e199af243136b4dc4a83929e8c9a185c9dcd8 /php/src/php5
parentUpdated AutoStart description (diff)
downloadice-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/php5')
-rw-r--r--php/src/php5/Connection.cpp6
-rw-r--r--php/src/php5/Connection.h5
-rw-r--r--php/src/php5/Proxy.cpp93
3 files changed, 103 insertions, 1 deletions
diff --git a/php/src/php5/Connection.cpp b/php/src/php5/Connection.cpp
index bdec7d1264b..9718c576cb9 100644
--- a/php/src/php5/Connection.cpp
+++ b/php/src/php5/Connection.cpp
@@ -21,8 +21,12 @@ ZEND_EXTERN_MODULE_GLOBALS(ice)
//
// Class entries represent the PHP class implementations we have registered.
//
-static zend_class_entry* connectionClassEntry = 0;
+namespace IcePHP
+{
+
+zend_class_entry* connectionClassEntry = 0;
+}
static zend_class_entry* connectionInfoClassEntry = 0;
static zend_class_entry* ipConnectionInfoClassEntry = 0;
static zend_class_entry* tcpConnectionInfoClassEntry = 0;
diff --git a/php/src/php5/Connection.h b/php/src/php5/Connection.h
index 191e3b218c7..66d70614c9b 100644
--- a/php/src/php5/Connection.h
+++ b/php/src/php5/Connection.h
@@ -15,6 +15,11 @@
namespace IcePHP
{
+//
+// Class entry.
+//
+extern zend_class_entry* connectionClassEntry;
+
bool connectionInit(TSRMLS_D);
bool createConnection(zval*, const Ice::ConnectionPtr& TSRMLS_DC);
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<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() 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<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() TSRMLS_CC);
@@ -1242,6 +1300,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)
@@ -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)