static function useConfig($zone, $type = "host")
{
$key = $zone . ":" . $type;
if (isset(self::$_instances[$key])) {
self::$_rc = self::$_instances[$key];
return self::$_rc;
}
$hosts = array();
$options = array();
$config = self::getConfig($zone, $type);
if (empty($config)) {
trigger_error("the redis hosts is not set in config file(" . self::$_config . ")");
return false;
}
if (is_array($config)) {
$hosts = $config;
} else {
$hosts[] = $config;
}
$config = self::getConfig($zone, "options");
if (!empty($config)) {
if (is_object($config)) {
foreach ($config as $k => $v) {
$options[$k] = $v;
}
}
}
return self::$_rc = self::$_instances[$key] = new RedisArray($hosts, $options);
}