AMQPConnection
PHP Manual

AMQPConnection::__construct

(PECL amqp >= Unknown)

AMQPConnection::__construct — Create an instance of AMQPConnection

説明

AMQPConnection::__construct ([ array $credentials = array() ] )

Creates an AMQPConnection instance representing a connection to an AMQP broker.

パラメータ

credentials

The credentials is an optional array of credential information for connecting to the AMQP broker. The keys used in the credentials array are: host, port, vhost, login and password. All other keys will be ignored.

For each missing credential, the extension will check the ini settings or use the default value.

返り値

An AMQPConnection object.

例

例1 AMQPConnection::__construct() example

<?php

/* Create a connection using all default credentials: */
$connection1 = new AMQPConnection();

$connection2 = new AMQPConnection(array(
    
'host' => 'example.host',
    
'vhost' => '/',
    
'port' => 5763,
    
'login' => 'user',
    
'password' => 'password'
));

?>


AMQPConnection
PHP Manual