installed plugin Infinite Uploads
version 2.0.8
This commit is contained in:
32
wp-content/plugins/infinite-uploads/vendor/Aws3/Aws/PsrCacheAdapter.php
vendored
Normal file
32
wp-content/plugins/infinite-uploads/vendor/Aws3/Aws/PsrCacheAdapter.php
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace UglyRobot\Infinite_Uploads\Aws;
|
||||
|
||||
use UglyRobot\Infinite_Uploads\Psr\Cache\CacheItemPoolInterface;
|
||||
class PsrCacheAdapter implements \UglyRobot\Infinite_Uploads\Aws\CacheInterface
|
||||
{
|
||||
/** @var CacheItemPoolInterface */
|
||||
private $pool;
|
||||
public function __construct(\UglyRobot\Infinite_Uploads\Psr\Cache\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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user