PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

AMQPConnection::disconnect

(PECL amqp >= Unknown)

AMQPConnection::disconnectCloses the connection with the AMQP broker.

Description

public bool AMQPConnection::disconnect ( void )

This method will close an open connection with the AMQP broker.

Parameters

void

Return Values

Returns true if connection was successfully closed, false otherwise.

Examples

Example #1 AMQPConnection::disconnect example

<?php

/* Create a new connection */
$cnn = new AMQPConnection();

// set the login details
$cnn->setLogin('mylogin');
$cnn->setPassword('mypass');

if (!
$cnn->connect()) {
    throw new 
Exception('Could not connect');
}

// do something interesting

if (!$cnn->disconnect()) {
    throw new 
Exception('Could not disconnect');
}

?>

PHP Manual