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.
This commit is contained in:
Josh Sherman 2013-12-15 16:30:12 -05:00
parent 061d7aee73
commit 7063b7aafe
5 changed files with 109 additions and 5 deletions

31
modules/user/create.php Normal file
View file

@ -0,0 +1,31 @@
<?php
class user_create extends CustomModule
{
//protected $ajax = true;
//protected $method = 'POST';
//protected $validate = array(
// 'username' => array(
// 'length:>:30' => 'Usernames may not be more than 30 characters.',
// 'regex:is:/[^a-z0-9-]+/i' => 'Usernames may only contain alphanumeric characters or dashes.',
// 'regex:is:/^(-.+|.+-)$/' => 'Usernames may not start or end with a dash.',
// 'regex:is:/-{2,}/' => 'Usernames may not have two or more dashes in a row.',
// ),
// 'email' => array(
// 'length:>:100' => 'Email addresses may not be more than 100 characters.',
// 'filter:email' => 'Your email address is invalid.',
// ),
// 'password' => array(
// 'length:<:8' => 'Passwords may not be less than 8 characters.',
// ),
//);
public function __default()
{
var_dump($this->redis->set('test', sha1(microtime(true))));
var_dump($this->redis->get('test'));
var_dump($this->redis->info());
}
}
?>