示例#1
0
 public function __construct($vals = null)
 {
     if (!isset(self::$_TSPEC)) {
         self::$_TSPEC = array(1 => array('var' => 'client_protocol', 'type' => TType::I32), 2 => array('var' => 'username', 'type' => TType::STRING), 3 => array('var' => 'password', 'type' => TType::STRING), 4 => array('var' => 'configuration', 'type' => TType::MAP, 'ktype' => TType::STRING, 'vtype' => TType::STRING, 'key' => array('type' => TType::STRING), 'val' => array('type' => TType::STRING)));
     }
     if (is_array($vals)) {
         if (isset($vals['client_protocol'])) {
             $this->client_protocol = $vals['client_protocol'];
         }
         if (isset($vals['username'])) {
             $this->username = $vals['username'];
         }
         if (isset($vals['password'])) {
             $this->password = $vals['password'];
         }
         if (isset($vals['configuration'])) {
             $this->configuration = $vals['configuration'];
         }
     }
 }
示例#2
0
 public function write($output)
 {
     $xfer = 0;
     $xfer += $output->writeStructBegin('TCLIService_OpenSession_args');
     if ($this->req !== null) {
         if (!is_object($this->req)) {
             throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
         }
         $xfer += $output->writeFieldBegin('req', TType::STRUCT, 1);
         $xfer += $this->req->write($output);
         $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;
 }