<?php require_once 'Qconf.php'; // path with qconf prefix $paths = "__qconf_anchor_node"; var_dump(Qconf::getConf("__qconf_anchor_node")); var_dump(Qconf::getBatchConf("__qconf_anchor_node")); var_dump(Qconf::getBatchKeys("__qconf_anchor_node")); var_dump(Qconf::getHost("__qconf_anchor_node")); var_dump(Qconf::getAllHost("__qconf_anchor_node")); // native path without qconf prefix $native_path = "/qconf/__qconf_anchor_node"; var_dump(Qconf::getHostNative($native_path)); var_dump(Qconf::getAllHostNative($native_path));
/** * 1. default get */ echo "1. defalut get: " . PHP_EOL; $names = "__qconf_anchor_node"; var_dump(Qconf::getConf("__qconf_anchor_node")); var_dump(Qconf::getHost("__qconf_anchor_node")); var_dump(Qconf::getAllHost("__qconf_anchor_node")); /** * 2. wait if there is no value in share memory */ $idc = null; $flags = QconfConfig::QCONF_WAIT; echo PHP_EOL . "2. wait if there is no value in share memory: " . PHP_EOL; $names = "__qconf_anchor_node"; var_dump(Qconf::getHost("__qconf_anchor_node", $idc, $flags)); /** * 3. return immediately if there is no value in share memory */ $idc = null; $flags = QconfConfig::QCONF_NOWAIT; echo PHP_EOL . "3. return immediately if there is no value in share memory:" . PHP_EOL; $names = "__qconf_anchor_node"; var_dump(Qconf::getHost("__qconf_anchor_node", $idc, $flags)); /** * 4. get with the path directly */ echo PHP_EOL . "4. get with the path directly: " . PHP_EOL; $names = "/qconf/__qconf_anchor_node"; var_dump(Qconf::getHostNative("/qconf/__qconf_anchor_node")); var_dump(Qconf::getAllHostNative("/qconf/__qconf_anchor_node"));