runff 1.0 commit

This commit is contained in:
rock64
2019-04-29 16:09:00 +02:00
commit f1567f989b
1268 changed files with 98652 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<?php
namespace Aws;
use Psr\Cache\CacheItemPoolInterface;
class PsrCacheAdapter implements CacheInterface
{
/** @var CacheItemPoolInterface */
private $pool;
public function __construct(CacheItemPoolInterface $pool)
{
$this->pool = $pool;
}
public function get($key)
{
$item = $this->pool->getItem($key);
return $item->isHit() ? $item->get() : null;
}
public function set($key, $value, $ttl = 0)
{
$item = $this->pool->getItem($key);
$item->set($value);
if ($ttl > 0) {
$item->expiresAfter($ttl);
}
$this->pool->save($item);
}
public function remove($key)
{
$this->pool->deleteItem($key);
}
}