Predefined Constants

The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime.

YAR_VERSION (string)
The version of the Yar extension, e.g. "2.4.0".
YAR_HAS_MSGPACK (int)
1 when Yar was built with --enable-msgpack, otherwise 0.
YAR_CLIENT_PROTOCOL_HTTP (int)
Identifies the HTTP protocol, exposed through the read-only _protocol property of Yar_Client.
YAR_CLIENT_PROTOCOL_TCP (int)
Identifies the TCP protocol, exposed through the read-only _protocol property of Yar_Client.
YAR_CLIENT_PROTOCOL_UNIX (int)
Identifies the Unix socket protocol, exposed through the read-only _protocol property of Yar_Client.
YAR_OPT_PACKAGER (int)
Client option to override the yar.packager directive for a single client. The value must be one of php, json or msgpack.
YAR_OPT_PERSISTENT (int)
Client option to enable persistent connections. When set to a truthy value, HTTP keep-alive is used so that repeated calls to the same server reuse the connection for the rest of the PHP request lifecycle.
YAR_OPT_TIMEOUT (int)
Client option to override the yar.timeout directive, in milliseconds.
YAR_OPT_CONNECT_TIMEOUT (int)
Client option to override the yar.connect_timeout directive, in milliseconds.
YAR_OPT_HEADER (int)
Client option to add custom HTTP headers. The value must be an array of strings like "X-Custom: value". Only effective with the HTTP and HTTPS protocols. Available as of Yar 2.0.4.
YAR_OPT_RESOLVE (int)
Client option to override hostname resolution for HTTP calls. The value must be an array of strings in the format HOST:PORT:ADDRESS, following the curl CURLOPT_RESOLVE syntax. Requires libcurl >= 7.21.3. Available as of Yar 2.1.0.
YAR_OPT_PROXY (int)
Client option to route HTTP calls through an HTTP proxy. The value must be a string such as 127.0.0.1:8888. Available as of Yar 2.2.0.
YAR_OPT_PROVIDER (int)
Client option carrying the provider identity sent with every request. The value must be a string of at most 32 bytes, which is passed to the server-side __auth magic method. Available as of Yar 2.3.0.
YAR_OPT_TOKEN (int)
Client option carrying the authentication token sent with every request. The value must be a string of at most 32 bytes, which is passed to the server-side __auth magic method. Available as of Yar 2.3.0.
YAR_PACKAGER_PHP (string)
The identifier of the php packager, "PHP".
YAR_PACKAGER_JSON (string)
The identifier of the json packager, "JSON".
YAR_PACKAGER_MSGPACK (string)
The identifier of the msgpack packager, "MSGPACK".
YAR_ERR_OKEY (int)
No error; the request was processed successfully.
YAR_ERR_PACKAGER (int)
A packager error, e.g. a body that could not be unpacked.
YAR_ERR_PROTOCOL (int)
A protocol error, e.g. a malformed Yar header.
YAR_ERR_REQUEST (int)
A request error, e.g. a call to an undefined or non-public method.
YAR_ERR_OUTPUT (int)
An output error, e.g. the server could not start its output buffer.
YAR_ERR_TRANSPORT (int)
A transport error, e.g. a connection failure or timeout.
YAR_ERR_EXCEPTION (int)
The remote service threw an exception while processing the request.
YAR_ERR_FORBIDDEN (int)
The request was rejected by the server's authentication (see the provider and token fields of the Yar protocol header).