/**
* * Add a value to the cache under a unique key
*
* @param string $key
* @param mixed $value
* @param int $ttl
*/
public function set($key, $value, $ttl = null)
{
$this->client->set($key, $value);
if ($ttl) {
$cmd = $this->client->createCommand('EXPIRE');
$cmd->setArguments(array($key, $ttl));
$this->client->executeCommand($cmd);
}
}