Пример #1
0
 /**
  * Read an AMQP table, and return as a PHP array. keys are strings,
  * values are (type,value) tuples.
  */
 public function read_table()
 {
     $this->bitcount = $this->bits = 0;
     $tlen = $this->read_php_int();
     if ($tlen < 0) {
         throw new AMQPOutOfBoundsException("Table is longer than supported");
     }
     $table_data = new AMQPReader($this->rawread($tlen), null);
     $result = array();
     while ($table_data->tell() < $tlen) {
         $name = $table_data->read_shortstr();
         $ftype = $table_data->rawread(1);
         $val = $table_data->read_value($ftype);
         $result[$name] = array($ftype, $val);
     }
     return $result;
 }