public function add($key, $value, $expire = 0)
{
if (!$this->lock($key)) {
return false;
}
if ($this->exists($key)) {
$this->unlock($key);
return false;
}
$path = $this->path($key);
$data = $this->wrap($value, $expire);
try {
$success = $this->filesystem->write($path, $data);
return $success && $this->unlock($key);
} catch (FileExistsException $e) {
$this->unlock($key);
return false;
}
}