Created
November 5, 2010 16:14
-
-
Save hSammir/664381 to your computer and use it in GitHub Desktop.
POC Koneksi PHP + Redis menggunakan rediska.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| * PHP + Redis dgn rediska | |
| * Kode POC ini di ciplak dari: http://rediska.geometria-lab.ru/documentation/get-started/ | |
| * Rediska: http://rediska.geometria-lab.ru/ | |
| * | |
| */ | |
| // Opsi konfigurasi rediska, alamat ip redis server dan port yg digunakan. (lihat redis.conf) | |
| $options = array( | |
| 'namespace' => 'Application_', | |
| 'servers' => array( | |
| array('host' => '127.0.0.1', 'port' => 6379), | |
| array('host' => '127.0.0.1', 'port' => 6380) | |
| ) | |
| ); | |
| require_once 'lib/Rediska.php'; // library rediska | |
| $rediska = new Rediska($options); | |
| // set key=>value | |
| $key = new Rediska_Key('nama'); | |
| $key->setValue('haddad'); | |
| print $key | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment