diff --git a/classes/CustomModule.php b/classes/CustomModule.php new file mode 100644 index 0000000..4c588dd --- /dev/null +++ b/classes/CustomModule.php @@ -0,0 +1,31 @@ +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) + { + + } + */ + } +} + +?> diff --git a/classes/CustomRedis.php b/classes/CustomRedis.php new file mode 100644 index 0000000..d27c372 --- /dev/null +++ b/classes/CustomRedis.php @@ -0,0 +1,30 @@ +redis) + { + $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) + { + exit('There was error connecting to Redis :('); + } + } + + return call_user_func_array(array($this->redis, $name), $arguments); + } +} + +?> diff --git a/config.php b/config.php index 19ec414..e834dca 100644 --- a/config.php +++ b/config.php @@ -58,7 +58,7 @@ $config = array( 'local' => array( 'redis' => array( 'type' => 'redis', - 'hostname' => 'localhost', + 'hostname' => '127.0.0.1', 'port' => 6379, 'database' => '0', 'namespace' => 'lb', @@ -67,7 +67,7 @@ $config = array( 'production' => array( 'redis' => array( 'type' => 'redis', - 'hostname' => 'localhost', + 'hostname' => '127.0.0.1', 'port' => 6381, 'database' => '0', 'namespace' => 'lb', diff --git a/modules/user/create.php b/modules/user/create.php new file mode 100644 index 0000000..7c68e93 --- /dev/null +++ b/modules/user/create.php @@ -0,0 +1,31 @@ + 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()); + } +} + +?> diff --git a/templates/join.phtml b/templates/join.phtml index afc4b46..5a9c7ed 100644 --- a/templates/join.phtml +++ b/templates/join.phtml @@ -1,4 +1,4 @@ -