Thrift-1942: Binary accelerated cpp extension does not use Thrift namespaces for Exceptions
Client: php
Patch: Tyler Hobbs
Adds namespaced TException to the accelerated php client lib.
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 0d741c2..551d438 100644
--- a/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp
+++ b/lib/php/src/ext/thrift_protocol/php_thrift_protocol.cpp
@@ -423,7 +423,7 @@
zval* ex;
MAKE_STD_ZVAL(ex);
- createObject("TProtocolException", ex, 2, zwhat, zerrorcode);
+ createObject("\\Thrift\\Exception\\TProtocolException", ex, 2, zwhat, zerrorcode);
zval_ptr_dtor(&zwhat);
zval_ptr_dtor(&zerrorcode);
throw PHPExceptionWrapper(ex);
@@ -1101,7 +1101,7 @@
if (messageType == T_EXCEPTION) {
zval* ex;
MAKE_STD_ZVAL(ex);
- createObject("TApplicationException", ex);
+ createObject("\\Thrift\\Exception\\TApplicationException", ex);
zval* spec = zend_read_static_property(zend_get_class_entry(ex TSRMLS_CC), "_TSPEC", 6, false TSRMLS_CC);
binary_deserialize_spec(ex, transport, Z_ARRVAL_P(spec));
throw PHPExceptionWrapper(ex);