Categories
PHP

remodel, PHP models for redis

PHP CRUD for redis. You will need predis to make it work 😉

Hope you enjoy still loads of things todo and to improve, but it does the work.

Small example:

///MODEL EXAMPLE
class Model_Post extends Remodel {
    protected $_table_name  = 'posts';
    protected $_primary_key = 'id_post';
    protected $_fields = array( 'id_post','title','description');
}
//CREATE:
$post = new Model_Post();
$post->title 		= 'test title'.time();
$post->description 	= 'test description';
$post->save();

See the gist here.