Skip to content

Instantly share code, notes, and snippets.

@hSammir
Created November 5, 2010 16:14
Show Gist options
  • Select an option

  • Save hSammir/664381 to your computer and use it in GitHub Desktop.

Select an option

Save hSammir/664381 to your computer and use it in GitHub Desktop.
POC Koneksi PHP + Redis menggunakan rediska.
<?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