K2hdkc::__construct
Creates a K2hdkc instance
Description
public function __construct(
string $config_file,
int $port = 8031,
string $cuk = null,
bool $rejoin = true,
bool $rejoin_forever = true,
bool $clear_backup = true) {}
Creates a K2hdkc instance.
Parameters
- config_file
Specify a chmpx slave configuration file. - port
Specify the port that chmpx slave process listens. - cuk
Specify thecuk
string that is a unique string for each node in the cluster. - rejoin
Specifytrue
when reconnecting with chmpx slave process. - rejoin_forever
Specifytrue
when reconnecting with chmpx slave process infinitely. - clear_backup
Specifytrue
when removing the temporary files
Examples
- Example 1 - Creates a K2hdkc instance
php -r '
k2hdkc = new K2hdkc("tests/slave.ini");
var_dump($k2hdkc->setValue("key1", "val1"));
var_dump($k2hdkc->getValue("key1"));
unset($k2hdkc);
'
The above example will output:
bool(true)
string(4) "val1"
See Also
- K2hdkc::__destruct - Destructs a K2hdkc instance