diff options
Diffstat (limited to 'php/src/php7/Operation.cpp')
-rw-r--r-- | php/src/php7/Operation.cpp | 65 |
1 files changed, 32 insertions, 33 deletions
diff --git a/php/src/php7/Operation.cpp b/php/src/php7/Operation.cpp index 73ee697c470..066f5d6d137 100644 --- a/php/src/php7/Operation.cpp +++ b/php/src/php7/Operation.cpp @@ -126,7 +126,7 @@ protected: OperationIPtr _op; - bool prepareRequest(int, zval*, Ice::OutputStreamPtr&, pair<const Ice::Byte*, const Ice::Byte*>&); + bool prepareRequest(int, zval*, Ice::OutputStream*, pair<const Ice::Byte*, const Ice::Byte*>&); void unmarshalResults(int, zval*, zval*, const pair<const Ice::Byte*, const Ice::Byte*>&); void unmarshalException(zval*, const pair<const Ice::Byte*, const Ice::Byte*>&); bool validateException(const ExceptionInfoPtr&) const; @@ -145,16 +145,16 @@ public: virtual void invoke(INTERNAL_FUNCTION_PARAMETERS); }; -class UserExceptionReaderFactoryI : public Ice::UserExceptionReaderFactory +class UserExceptionFactory : public Ice::UserExceptionFactory { public: - UserExceptionReaderFactoryI(const CommunicatorInfoPtr& communicator) : + UserExceptionFactory(const CommunicatorInfoPtr& communicator) : _communicator(communicator) { } - virtual void createAndThrow(const string& id) const + virtual void createAndThrow(const string& id) { ExceptionInfoPtr info = getExceptionInfo(id); if(info) @@ -420,7 +420,7 @@ IcePHP::TypedInvocation::TypedInvocation(const Ice::ObjectPrx& prx, const Commun } bool -IcePHP::TypedInvocation::prepareRequest(int argc, zval* args, Ice::OutputStreamPtr& os, +IcePHP::TypedInvocation::prepareRequest(int argc, zval* args, Ice::OutputStream* os, pair<const Ice::Byte*, const Ice::Byte*>& params) { // @@ -448,7 +448,6 @@ IcePHP::TypedInvocation::prepareRequest(int argc, zval* args, Ice::OutputStreamP // // Marshal the in parameters. // - os = Ice::createOutputStream(_communicator->getCommunicator()); os->startEncapsulation(_prx->ice_getEncodingVersion(), _op->format); ObjectMap objectMap; @@ -503,7 +502,7 @@ IcePHP::TypedInvocation::prepareRequest(int argc, zval* args, Ice::OutputStreamP if(_op->sendsClasses) { - os->writePendingObjects(); + os->writePendingValues(); } os->endEncapsulation(); @@ -527,17 +526,17 @@ void IcePHP::TypedInvocation::unmarshalResults(int argc, zval* args, zval* ret, const pair<const Ice::Byte*, const Ice::Byte*>& bytes) { - Ice::InputStreamPtr is = Ice::wrapInputStream(_communicator->getCommunicator(), bytes); + Ice::InputStream is(_communicator->getCommunicator(), bytes); // - // Store a pointer to a local SlicedDataUtil object as the stream's closure. + // Store a pointer to a local StreamUtil object as the stream's closure. // This is necessary to support object unmarshaling (see ObjectReader). // - SlicedDataUtil util; - assert(!is->closure()); - is->closure(&util); + StreamUtil util; + assert(!is.getClosure()); + is.setClosure(&util); - is->startEncapsulation(); + is.startEncapsulation(); ParamInfoList::iterator p; @@ -560,7 +559,7 @@ IcePHP::TypedInvocation::unmarshalResults(int argc, zval* args, zval* ret, { ResultCallbackPtr cb = new ResultCallback; outParamCallbacks[info->pos] = cb; - info->type->unmarshal(is, cb, _communicator, 0, 0, false); + info->type->unmarshal(&is, cb, _communicator, 0, 0, false); } } @@ -570,7 +569,7 @@ IcePHP::TypedInvocation::unmarshalResults(int argc, zval* args, zval* ret, if(_op->returnType && !_op->returnType->optional) { retCallback = new ResultCallback; - _op->returnType->type->unmarshal(is, retCallback, _communicator, 0, 0, false); + _op->returnType->type->unmarshal(&is, retCallback, _communicator, 0, 0, false); } // @@ -590,9 +589,9 @@ IcePHP::TypedInvocation::unmarshalResults(int argc, zval* args, zval* ret, outParamCallbacks[info->pos] = cb; } - if(is->readOptional(info->tag, info->type->optionalFormat())) + if(is.readOptional(info->tag, info->type->optionalFormat())) { - info->type->unmarshal(is, cb, _communicator, 0, 0, true); + info->type->unmarshal(&is, cb, _communicator, 0, 0, true); } else { @@ -602,12 +601,12 @@ IcePHP::TypedInvocation::unmarshalResults(int argc, zval* args, zval* ret, if(_op->returnsClasses) { - is->readPendingObjects(); + is.readPendingValues(); } - is->endEncapsulation(); + is.endEncapsulation(); - util.update(); + util.updateSlicedData(); int i = static_cast<int>(_op->inParams.size()); for(ResultCallbackList::iterator q = outParamCallbacks.begin(); q != outParamCallbacks.end(); ++q, ++i) @@ -632,38 +631,38 @@ IcePHP::TypedInvocation::unmarshalResults(int argc, zval* args, zval* ret, void IcePHP::TypedInvocation::unmarshalException(zval* zex, const pair<const Ice::Byte*, const Ice::Byte*>& bytes) { - Ice::InputStreamPtr is = Ice::wrapInputStream(_communicator->getCommunicator(), bytes); + Ice::InputStream is(_communicator->getCommunicator(), bytes); // - // Store a pointer to a local SlicedDataUtil object as the stream's closure. + // Store a pointer to a local StreamUtil object as the stream's closure. // This is necessary to support object unmarshaling (see ObjectReader). // - SlicedDataUtil util; - assert(!is->closure()); - is->closure(&util); + StreamUtil util; + assert(!is.getClosure()); + is.setClosure(&util); - is->startEncapsulation(); + is.startEncapsulation(); try { - Ice::UserExceptionReaderFactoryPtr factory = new UserExceptionReaderFactoryI(_communicator); - is->throwException(factory); + Ice::UserExceptionFactoryPtr factory = new UserExceptionFactory(_communicator); + is.throwException(factory); } catch(const ExceptionReader& r) { - is->endEncapsulation(); + is.endEncapsulation(); zval* ex = r.getException(); ExceptionInfoPtr info = r.getInfo(); if(validateException(info)) { - util.update(); + util.updateSlicedData(); Ice::SlicedDataPtr slicedData = r.getSlicedData(); if(slicedData) { - SlicedDataUtil::setMember(ex, slicedData); + StreamUtil::setSlicedDataMember(ex, slicedData); } ZVAL_DUP(zex, ex); return; @@ -736,9 +735,9 @@ IcePHP::SyncTypedInvocation::invoke(INTERNAL_FUNCTION_PARAMETERS) return; } - Ice::OutputStreamPtr os; + Ice::OutputStream os(_prx->ice_getCommunicator()); pair<const Ice::Byte*, const Ice::Byte*> params; - if(!prepareRequest(ZEND_NUM_ARGS(), args, os, params)) + if(!prepareRequest(ZEND_NUM_ARGS(), args, &os, params)) { return; } |