leaderbin/classes/CustomModule.php
Josh Sherman 7063b7aafe Built a simple wrapper for phpredis
Not every page / page view will need to connect to Redis, set it up so the connect isn't made until a call is made, lazy connect if you will.
2013-12-15 16:30:12 -05:00

31 lines
524 B
PHP

<?php
class CustomModule extends Module
{
protected $redis = false;
public function __construct()
{
parent::__construct();
$this->redis = new CustomRedis();
/*
$datasource = $this->config->datasources['redis'];
try
{
$this->redis = new Redis();
$this->redis->connect($datasource['hostname'], $datasource['port']);
$this->redis->setOption(Redis::OPT_PREFIX, $datasource['namespace'] . ':');
$this->redis->select($datasource['database']);
}
catch (RedisException $e)
{
}
*/
}
}
?>