1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-05 02:39:47 +02:00
ampache/modules/React/Cache/ArrayCache.php

29 lines
478 B
PHP

<?php
namespace React\Cache;
use React\Promise\When;
class ArrayCache implements CacheInterface
{
private $data = array();
public function get($key)
{
if (!isset($this->data[$key])) {
return When::reject();
}
return When::resolve($this->data[$key]);
}
public function set($key, $value)
{
$this->data[$key] = $value;
}
public function remove($key)
{
unset($this->data[$key]);
}
}