-- Protocol and transport factories now wrap around a single protocol/transport
Summary:
- This is an analagous to the C++ change made in r31441
Reviewed By: slee
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664977 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/php/src/protocol/TProtocol.php b/lib/php/src/protocol/TProtocol.php
index eb150e3..9519604 100644
--- a/lib/php/src/protocol/TProtocol.php
+++ b/lib/php/src/protocol/TProtocol.php
@@ -6,6 +6,7 @@
*
* @package thrift.protocol
* @author Mark Slee <mcslee@facebook.com>
+ * @author Aditya Agarwal <aditya@facebook.com>
*/
/**
@@ -45,43 +46,26 @@
abstract class TProtocol {
/**
- * Input transport
+ * Underlying transport
*
* @var TTransport
*/
- protected $inputTransport_;
-
- /**
- * Output transport
- *
- * @var TTransport
- */
- protected $outputTransport_;
+ protected $trans_;
/**
* Constructor
*/
- protected function __construct($in, $out=null) {
- $this->inputTransport_ = $in;
- $this->outputTransport_ = $out ? $out : $in;
+ protected function __construct($trans) {
+ $this->trans_ = $trans;
}
/**
- * Accessor for input
+ * Accessor for transport
*
* @return TTransport
*/
- public function getInputTransport() {
- return $this->inputTransport_;
- }
-
- /**
- * Accessor for output
- *
- * @return TTransport
- */
- public function getOutputTransport() {
- return $this->outputTransport_;
+ public function getTransport() {
+ return $this->trans_;
}
/**
@@ -373,11 +357,11 @@
*/
interface TProtocolFactory {
/**
- * Build input and output protocols from the given transports.
+ * Build a protocol from the base transport
*
- * @return array Two elements, (iprot, oprot)
+ * @return TProtcol protocol
*/
- public function getIOProtocols($itrans, $otrans);
+ public function getProtocol($trans);
}