Skip to Content

g6Appliance

 object = new g6Appliance::g6Appliance(string $uri, string $mode=API_MODE_PASSIVE);

The g6Appliance class is the top level class of the Gear6 API. This is the class that should be instantiated to work with a Web Cache Appliance. This class contains calls to general settings and states of the Appliance including adding, deleting, and modifying memcache services.

Parameter Type Description
$uri string URI string of the Web Cache Appliance to connect to. Format must conform to: '$protocol://$user:$password@$host:$port'
$mode string API Mode to use. Defaults to API_MODE_PASSIVE if not provided. Possible values are:

Supported protocols are HTTP or HTTPS

Example: The below example shows how to create a connection to a Web Cache Appliance and retrieve the release version of the Appliance.
/* Example Code */

include('g6Appliance.php');
$uri = 'http://$user:$password@$host:$port';
$g6 = new g6Appliance($uri, API_MODE_PASSIVE);
if ($g6->authenticate() == FALSE) {
    echo('Error tring to authenticate against ' . $uri . "n");
    exit(1);
}

echo('Release: ' . $g6->getRelease() . "n");