(PECL yar >= 1.0.0)
Yar_Client::__construct — Create a client
Creates a Yar_Client for the RPC service located
at uri.
uri
Address of the RPC service. The protocol is derived from the scheme:
http:// and https:// select the
HTTP transport, tcp:// selects the TCP transport,
and unix:// selects the Unix socket transport.
options
An array of client options, keyed by the
YAR_OPT_* constants, equivalent to calling
Yar_Client::setOpt() for each entry. Invalid
options are silently skipped.
A new Yar_Client instance.
If the URI does not start with a supported scheme, a Yar_Client_Protocol_Exception is thrown.
Example #1 Yar_Client::__construct() example
<?php
$client = new Yar_Client("http://host/api/");
/* with options */
$client = new Yar_Client("http://host/api/", [
YAR_OPT_TIMEOUT => 1000,
YAR_OPT_PACKAGER => "json",
]);
?>