function index() { try { $this->redis = lib\redis\RedisClient::getPredisObject(); $this->set('server_info', $this->redis->info()); $this->set("environments", $this->Config->exists("environment") ? $this->Config->get("environment") : false); } catch (Exception $e) { $this->set("redis_error", true); } $this->render(); }
function __construct() { parent::__construct(); if (isset($_SESSION['redis_environment'])) { $port = $this->Config->get("environment", $_SESSION['redis_environment']); if ($port) { lib\redis\RedisClient::setPort($port); } } $this->redis = lib\redis\RedisClient::getPredisObject(); if (isset($_SESSION['redis_db'])) { $this->redis->select(intval($_SESSION['redis_db'])); } }