public function declareExchange() {

        $durable = boolval($this->flags & AMQP_DURABLE);
        $passive = boolval($this->flags & AMQP_PASSIVE);
        $auto_delete = boolval($this->flags & AMQP_AUTODELETE);

        try {
            $this->channel->_getChannel()->exchange_declare($this->name, $this->type, $passive, $durable, $auto_delete);
        } catch (AMQPRuntimeException $e) {
            throw new AMQPConnectionException($e->getMessage(), $e->getCode(), $e->getPrevious());
        } catch (Exception $e) {
            throw new AMQPExchangeException($e->getMessage(), $e->getCode(), $e->getPrevious());
        }

        return true;
    }
public function declareExchange() {

        $durable = boolval($this->flags & AMQP_DURABLE);
        $passive = boolval($this->flags & AMQP_PASSIVE);
        $auto_delete = boolval($this->flags & AMQP_AUTODELETE);

        try {
            $this->channel->_getChannel()->exchange_declare($this->name, $this->type, $passive, $durable, $auto_delete);
        } catch (AMQPRuntimeException $e) {
            throw new AMQPConnectionException($e->getMessage(), $e->getCode(), $e->getPrevious());
        } catch (Exception $e) {
            throw new AMQPExchangeException($e->getMessage(), $e->getCode(), $e->getPrevious());
        }

        return true;
    }
public function declareExchange ( ) { $ durable = boolval ( $ this -> flags & AMQP_DURABLE ) ; $ passive = boolval ( $ this -> flags & AMQP_PASSIVE ) ; $ auto_delete = boolval ( $ this -> flags & AMQP_AUTODELETE ) ; try { $ this -> channel -> _getChannel ( ) -> exchange_declare ( $ this -> name , $ this -> type , $ passive , $ durable , $ auto_delete ) ; } catch ( AMQPRuntimeException $ e ) { throw new AMQPConnectionException ( $ e -> getMessage ( ) , $ e -> getCode ( ) , $ e -> getPrevious ( ) ) ; } catch ( Exception $ e ) { throw new AMQPExchangeException ( $ e -> getMessage ( ) , $ e -> getCode ( ) , $ e -> getPrevious ( ) ) ; } return true ; }
Declare a new exchange on the broker.

@throws AMQPExchangeException   On failure.
@throws AMQPChannelException    If the channel is not open.
@throws AMQPConnectionException If the connection to the broker was lost.

@return boolean TRUE on success or FALSE on failure.
Declare a new exchange on the broker .