Skip to content

Commit de5ae9f

Browse files
committed
Lots of fixes
1 parent a680a39 commit de5ae9f

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/DependencyInjection/AequasiCacheExtension.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public function load(array $configs, ContainerBuilder $container)
4343

4444
if ($config['router']['enabled']) {
4545
$container->setParameter($this->getAlias() . '.router', $config['router']);
46-
//new Builder\RouterBuilder($container);
4746
}
4847

4948
if ($config['session']['enabled']) {

src/DependencyInjection/Compiler/RouterCompilerPass.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
class RouterCompilerPass extends BaseCompilerPass
2020
{
2121
/**
22-
* @return mixed|void
22+
* @return void
2323
*/
2424
protected function prepare()
2525
{
@@ -28,9 +28,7 @@ protected function prepare()
2828
if (!$router['enabled']) {
2929
return;
3030
}
31-
32-
$config = $this->container->getParameter('aequasi_cache.router');
33-
$instance = $config['instance'];
31+
$instance = $router['instance'];
3432

3533
$def = $this->container->findDefinition('router');
3634
$def->setClass('Aequasi\Bundle\CacheBundle\Routing\Router');

src/Routing/Matcher/CacheUrlMatcher.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
*/
2020
class CacheUrlMatcher extends UrlMatcher
2121
{
22+
const CACHE_LIFETIME = 604800; // a week
23+
2224
/**
23-
* @var CachePool
25+
* @var CacheItemPoolInterface
2426
*/
2527
protected $cache;
2628

@@ -40,7 +42,9 @@ public function match($pathInfo)
4042
}
4143

4244
$match = parent::match($pathInfo);
43-
$this->cache->saveItem($key, $match, 60 * 60 * 24 * 7);
45+
$item = $this->cache->getItem($key);
46+
$item->set($match)
47+
->expiresAfter(self::CACHE_LIFETIME);
4448

4549
return $match;
4650
}

src/Session/SessionHandler.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ public function write($sessionId, $data)
8989
{
9090
$item = $this->cache->getItem($this->prefix . $sessionId);
9191
$item->set($data)
92-
// TODO is this the correct function?
9392
->expiresAfter($this->ttl);
9493

9594
return $this->cache->save($item);

0 commit comments

Comments
 (0)