string TException = "use Thrift\\Exception\\TException;\n";
string TProtocolException = "use Thrift\\Exception\\TProtocolException;\n";
string TProtocol = "use Thrift\\Protocol\\TProtocol;\n";
+ string TBinaryProtocolAccelerated = "use Thrift\\Protocol\\TBinaryProtocolAccelerated;\n";
string TApplicationException = "use Thrift\\Exception\\TApplicationException;\n\n";
- return TBase + TType + TMessageType + TException + TProtocolException + TProtocol + TApplicationException;
+ return TBase + TType + TMessageType + TException + TProtocolException + TProtocol + TBinaryProtocolAccelerated + TApplicationException;
}
/**
}
f_service_ <<
- indent() << "$bin_accel = ($output instanceof " << "TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');" << endl;
+ indent() << "$bin_accel = ($output instanceof " << "TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');" << endl;
f_service_ <<
indent() << "if ($bin_accel)" << endl;
}
f_service_ <<
- indent() << "$bin_accel = ($this->output_ instanceof " << "TProtocol::$TBINARYPROTOCOLACCELERATED) && function_exists('thrift_protocol_write_binary');" << endl;
+ indent() << "$bin_accel = ($this->output_ instanceof " << "TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');" << endl;
f_service_ <<
indent() << "if ($bin_accel)" << endl;
scope_up(f_service_);
f_service_ <<
- indent() << "$bin_accel = ($this->input_ instanceof " << "TProtocol::$TBINARYPROTOCOLACCELERATED)"
+ indent() << "$bin_accel = ($this->input_ instanceof " << "TBinaryProtocolAccelerated)"
<< " && function_exists('thrift_protocol_read_binary');" << endl;
f_service_ <<
* Protocol base class module.
*/
abstract class TProtocol {
- // The below may seem silly, but it is to get around the problem that the
- // "instanceof" operator can only take in a T_VARIABLE and not a T_STRING
- // or T_CONSTANT_ENCAPSED_STRING. Using "is_a()" instead of "instanceof" is
- // a workaround but is deprecated in PHP5. This is used in the generated
- // deserialization code.
- static $TBINARYPROTOCOLACCELERATED = 'TBinaryProtocolAccelerated';
/**
* Underlying transport