Skip to content

seppo0010/rlite-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rlite-php

Build Status

PHP bindings for rlite. For more information about rlite, go to rlite repository

Installation

Before installing rlite-php, you'll need to install rlite

git clone https://github.com/seppo0010/rlite.git
cd rlite
make && sudo make install

Now you can continue with the extension set up.

git clone https://github.com/seppo0010/rlite-php.git
cd phpiredis
phpize && ./configure --enable-rlite
make && sudo make install

Usage

$rlite = create_rlite_connection(':memory:');
rlite_command($rlite, ['RPUSH', 'test', '1', '2', '3']);
var_dump(rlite_command($rlite, ['LRANGE', 'test', '0', '-1']));
/*
array(3) {
  [0]=>
  string(1) "1"
  [1]=>
  string(1) "2"
  [2]=>
  string(1) "3"
}
*/

Persistence

$rlite = create_rlite_connection('./mydb.rld');
rlite_command($rlite, ['SET', 'key', 'value']);

$rlite = create_rlite_connection('./mydb.rld');
var_dump(rlite_command($rlite, ['GET', 'key']));
/*
string(5) "value"
*/

Releases

No releases published

Packages

No packages published