public function set($key, $var, $ttl = null)
{
if ($this->serialize) {
$var = serialize($var);
}
if ($ttl === null) {
$this->getImpl()->set($key, $var);
} else {
return $this->getImpl()->setex($key, $ttl, $var);
}
}