summaryrefslogtreecommitdiff
path: root/php/src
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2017-02-06 11:17:34 +0100
committerBenoit Foucher <benoit@zeroc.com>2017-02-06 11:17:34 +0100
commit18ab8207bd14def950fd399c60d9ee54fab75d3b (patch)
treea82af333127184acc6be6e0969919cb20be5e8b3 /php/src
parentFixed ICE-7548 - getAdminProxy no longer returns 0 if synchronization is in p... (diff)
downloadice-18ab8207bd14def950fd399c60d9ee54fab75d3b.tar.bz2
ice-18ab8207bd14def950fd399c60d9ee54fab75d3b.tar.xz
ice-18ab8207bd14def950fd399c60d9ee54fab75d3b.zip
Fixed ICE-7169 and ICE-7375 - add option to specify if batch requests flushed with the communicator/connection should be compressed
Diffstat (limited to 'php/src')
-rw-r--r--php/src/php5/Communicator.cpp18
-rw-r--r--php/src/php5/Connection.cpp14
2 files changed, 24 insertions, 8 deletions
diff --git a/php/src/php5/Communicator.cpp b/php/src/php5/Communicator.cpp
index c22723e53d7..964a255599d 100644
--- a/php/src/php5/Communicator.cpp
+++ b/php/src/php5/Communicator.cpp
@@ -807,17 +807,25 @@ ZEND_METHOD(Ice_Communicator, setDefaultLocator)
ZEND_METHOD(Ice_Communicator, flushBatchRequests)
{
- CommunicatorInfoIPtr _this = Wrapper<CommunicatorInfoIPtr>::value(getThis() TSRMLS_CC);
- assert(_this);
+ zval* compress;
+ if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, const_cast<char*>("z"), &compress TSRMLS_CC) != SUCCESS)
+ {
+ RETURN_NULL();
+ }
- if(ZEND_NUM_ARGS() != 8)
+ if(Z_TYPE_P(compress) != IS_LONG)
{
- WRONG_PARAM_COUNT;
+ invalidArgument("value for 'compress' argument must be an enumerator of CompressBatch" TSRMLS_CC);
+ RETURN_NULL();
}
+ Ice::CompressBatch cb = static_cast<Ice::CompressBatch>(Z_LVAL_P(compress));
+
+ CommunicatorInfoIPtr _this = Wrapper<CommunicatorInfoIPtr>::value(getThis() TSRMLS_CC);
+ assert(_this);
try
{
- _this->getCommunicator()->flushBatchRequests();
+ _this->getCommunicator()->flushBatchRequests(cb);
}
catch(const IceUtil::Exception& ex)
{
diff --git a/php/src/php5/Connection.cpp b/php/src/php5/Connection.cpp
index 68827e63243..12aa1a7c2aa 100644
--- a/php/src/php5/Connection.cpp
+++ b/php/src/php5/Connection.cpp
@@ -128,17 +128,25 @@ ZEND_METHOD(Ice_Connection, getEndpoint)
ZEND_METHOD(Ice_Connection, flushBatchRequests)
{
- if(ZEND_NUM_ARGS() > 0)
+ zval* compress;
+ if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, const_cast<char*>("z"), &compress TSRMLS_CC) != SUCCESS)
{
- WRONG_PARAM_COUNT;
+ RETURN_NULL();
+ }
+
+ if(Z_TYPE_P(compress) != IS_LONG)
+ {
+ invalidArgument("value for 'compress' argument must be an enumerator of CompressBatch" TSRMLS_CC);
+ RETURN_NULL();
}
+ Ice::CompressBatch cb = static_cast<Ice::CompressBatch>(Z_LVAL_P(compress));
Ice::ConnectionPtr _this = Wrapper<Ice::ConnectionPtr>::value(getThis() TSRMLS_CC);
assert(_this);
try
{
- _this->flushBatchRequests();
+ _this->flushBatchRequests(cb);
}
catch(const IceUtil::Exception& ex)
{