# media-cloud-sync/1.2.0/includes/sdk/s3/Aws/PsrCacheAdapter.php

Media Cloud Sync, version 1.2.0. 33 lines.

- Page: https://pluginprobe.com/plugins/media-cloud-sync/1.2.0/code/includes/sdk/s3/Aws/PsrCacheAdapter.php
- Raw: https://pluginprobe.com/plugins/media-cloud-sync/1.2.0/raw/includes/sdk/s3/Aws/PsrCacheAdapter.php
- Modified: 2024-10-27T10:40:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/media-cloud-sync/1.2.0/code/includes/sdk/s3/Aws/PsrCacheAdapter.php#L10-L20`.

```php
<?php

namespace Dudlewebs\WPMCS\s3\Aws;

use Dudlewebs\WPMCS\s3\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);
    }
}

```
