Rediska

Follow me on twitter…

Instance name

You can assign name to Rediska instance so that you can identify it from other Rediska components or get it from instance manager:

<?php

// Create rediska instance with name 'cache'
$options = array(
    'namespace' => 'Cache_'
    'name'      => 'cache'
);
$rediska = new Rediska($options);

// Create key with 'cache' instance
$cache = new Rediska_Key('cache', array('rediska' => 'cache'));

// Get 'cache' instance from instance manager
$rediska = Rediska_Manager::get('cache');

?>

Set addToManager option to false to not add instance to manager:

<?php

$options = array(
    'name'         => 'cache',
    'addToManager' => false,
);
$rediska = new Rediska($options);

print Rediska_Manager::has('cache'); #=> false

?>

Comments

Fork me on GitHub