summaryrefslogtreecommitdiff
path: root/php/src
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2017-02-06 17:39:23 +0100
committerJose <jose@zeroc.com>2017-02-06 17:39:23 +0100
commit8c3e55b2defa3ac108474738ae168b1942632213 (patch)
tree3dbbe11cf28c52225cc16ea0df1f1f7ea6fde496 /php/src
parentAdd support for build with VS 2017 RC (diff)
downloadice-8c3e55b2defa3ac108474738ae168b1942632213.tar.bz2
ice-8c3e55b2defa3ac108474738ae168b1942632213.tar.xz
ice-8c3e55b2defa3ac108474738ae168b1942632213.zip
Fix ICE-7561 - PHP Build failure
Diffstat (limited to 'php/src')
-rw-r--r--php/src/php7/Communicator.cpp20
-rw-r--r--php/src/php7/Connection.cpp18
2 files changed, 27 insertions, 11 deletions
diff --git a/php/src/php7/Communicator.cpp b/php/src/php7/Communicator.cpp
index b707cf962c6..2c63100e908 100644
--- a/php/src/php7/Communicator.cpp
+++ b/php/src/php7/Communicator.cpp
@@ -813,21 +813,29 @@ ZEND_METHOD(Ice_Communicator, setDefaultLocator)
ZEND_METHOD(Ice_Communicator, flushBatchRequests)
{
- CommunicatorInfoIPtr _this = Wrapper<CommunicatorInfoIPtr>::value(getThis());
- 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)
{
- throwException(ex);
+ throwException(ex TSRMLS_CC);
RETURN_NULL();
}
}
diff --git a/php/src/php7/Connection.cpp b/php/src/php7/Connection.cpp
index 57c0b197767..826878a194b 100644
--- a/php/src/php7/Connection.cpp
+++ b/php/src/php7/Connection.cpp
@@ -128,21 +128,29 @@ 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();
}
- Ice::ConnectionPtr _this = Wrapper<Ice::ConnectionPtr>::value(getThis());
+ 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)
{
- throwException(ex);
+ throwException(ex TSRMLS_CC);
RETURN_NULL();
}
}