コード例 #1
0
 /**
  * Handles connection blocked notifications
  *
  * @param AMQPReader $args
  */
 protected function connection_blocked(AMQPReader $args)
 {
     // Call the block handler and pass in the reason
     $this->dispatch_to_handler($this->connection_block_handler, array($args->read_shortstr()));
 }
コード例 #2
0
ファイル: AMQPChannel.php プロジェクト: greggcz/librenms
 /**
  * Returns a failed message
  *
  * @param AMQPReader $args
  * @param AMQPMessage $msg
  */
 protected function basic_return($args, $msg)
 {
     $reply_code = $args->read_short();
     $reply_text = $args->read_shortstr();
     $exchange = $args->read_shortstr();
     $routing_key = $args->read_shortstr();
     if (null !== $this->basic_return_callback) {
         call_user_func_array($this->basic_return_callback, array($reply_code, $reply_text, $exchange, $routing_key, $msg));
     } elseif ($this->debug) {
         MiscHelper::debug_msg('Skipping unhandled basic_return message');
     }
 }
コード例 #3
0
ファイル: Protocol091.php プロジェクト: cjsampson/codeup.dev
 /**
  * @param AMQPReader $reader
  * @return array
  */
 public static function basicGetEmpty(AMQPReader $reader)
 {
     $response = array();
     $response[] = $reader->read_shortstr();
     return $response;
 }
コード例 #4
0
ファイル: Protocol080.php プロジェクト: vongrad/loanbroker
 /**
  * @param AMQPReader $args
  * @return array
  */
 public static function streamCancelOk($args)
 {
     $ret = array();
     $ret[] = $args->read_shortstr();
     return $ret;
 }
コード例 #5
0
ファイル: AMQPReader.php プロジェクト: ohjack/newErp
 /**
  * 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;
 }
コード例 #6
0
ファイル: Protocol080.php プロジェクト: lewishealey/confetti
 /**
  * @param AMQPReader $reader
  * @return array
  */
 public static function streamCancelOk(AMQPReader $reader)
 {
     $response = array();
     $response[] = $reader->read_shortstr();
     return $response;
 }
コード例 #7
0
 protected function basic_cancel_from_server(AMQPReader $args)
 {
     $consumerTag = $args->read_shortstr();
     throw new AMQPBasicCancelException($consumerTag);
 }
コード例 #8
0
ファイル: AMQPReader.php プロジェクト: DBezemer/server
 /**
  * Read an AMQP table, and return as a PHP array. keys are strings,
  * values are (type,value) tuples.
  *
  * @param bool $returnObject Whether to return AMQPArray instance instead of plain array
  * @return array|AMQPTable
  */
 public function read_table($returnObject = false)
 {
     $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 = $returnObject ? new AMQPTable() : array();
     while ($table_data->tell() < $tlen) {
         $name = $table_data->read_shortstr();
         $ftype = AMQPAbstractCollection::getDataTypeForSymbol($ftypeSym = $table_data->rawread(1));
         $val = $table_data->read_value($ftype, $returnObject);
         $returnObject ? $result->set($name, $val, $ftype) : ($result[$name] = array($ftypeSym, $val));
     }
     return $result;
 }
コード例 #9
0
ファイル: Protocol091.php プロジェクト: adridev/php-amqplib
 /**
  * @param AMQPReader $args
  * @return array
  */
 public static function basicGetEmpty($args)
 {
     $ret = array();
     $ret[] = $args->read_shortstr();
     return $ret;
 }
コード例 #10
0
ファイル: AMQPChannel.php プロジェクト: lewishealey/confetti
 /**
  * Returns a failed message
  *
  * @param AMQPReader $reader
  * @param AMQPMessage $message
  * @return null
  */
 protected function basic_return($reader, $message)
 {
     $callback = $this->basic_return_callback;
     if (!is_callable($callback)) {
         $this->debug->debug_msg('Skipping unhandled basic_return message');
         return null;
     }
     $reply_code = $reader->read_short();
     $reply_text = $reader->read_shortstr();
     $exchange = $reader->read_shortstr();
     $routing_key = $reader->read_shortstr();
     call_user_func_array($callback, array($reply_code, $reply_text, $exchange, $routing_key, $message));
 }