From: boz Date: Thu, 1 Nov 2007 07:37:45 +0000 (+0000) Subject: THRIFT: update the thrift extension X-Git-Tag: 0.2.0~1156 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=8ebe4a1757145121f9af74d0d9f172d418771cfa;p=common%2Fthrift.git THRIFT: update the thrift extension Summary: more ZTS stuff Reviewed By: hzhao Test Plan: the same tests still pass git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665316 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp b/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp index e8a43bdf..38af4ab9 100644 --- a/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp +++ b/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp @@ -69,6 +69,7 @@ public: ZVAL_STRING(&gettransport, "getTransport", 0); MAKE_STD_ZVAL(t); ZVAL_NULL(t); + TSRMLS_FETCH(); call_user_function(EG(function_table), &p, &gettransport, t, 0, NULL TSRMLS_CC); } @@ -91,6 +92,8 @@ public: MAKE_STD_ZVAL(args[0]); ZVAL_STRINGL(args[0], newbuf, buffer_remaining, 0); + TSRMLS_FETCH(); + zval ret; call_user_function(EG(function_table), &t, &putbackfn, &ret, 1, args TSRMLS_CC); zval_ptr_dtor(args); @@ -128,6 +131,8 @@ protected: MAKE_STD_ZVAL(args[0]); ZVAL_LONG(args[0], buffer_size); + TSRMLS_FETCH(); + call_user_function(EG(function_table), &t, &funcname, &retval, 1, args TSRMLS_CC); zval_ptr_dtor(args); @@ -150,8 +155,9 @@ protected: // Does not call the ctor on the object, all fields will be NULL void createObject(char* obj_typename, zval* return_value) { + TSRMLS_FETCH(); size_t obj_typename_len = strlen(obj_typename); - zend_class_entry* ce = zend_fetch_class(obj_typename, obj_typename_len, ZEND_FETCH_CLASS_DEFAULT TSRMLS_DC); + zend_class_entry* ce = zend_fetch_class(obj_typename, obj_typename_len, ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC); if (! ce) { php_error_docref(NULL TSRMLS_CC, E_ERROR, "Class %s does not exist", obj_typename); RETURN_NULL(); @@ -178,6 +184,7 @@ void binary_deserialize(long thrift_typeID, PHPTransport& transport, zval* retur zval funcname; ZVAL_STRING(&funcname, "read", 0); transport.put_back(); // return our buffer to the userland T{Framed,Buffered}Transport for reading the field headers and such + TSRMLS_FETCH(); call_user_function(EG(function_table), &return_value, &funcname, &retval, 1, args TSRMLS_CC); zval_dtor(&retval); return; @@ -306,6 +313,7 @@ void binary_deserialize(long thrift_typeID, PHPTransport& transport, zval* retur return; } default: + TSRMLS_FETCH(); php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unknown thrift typeID %ld", thrift_typeID); RETURN_NULL(); };