Skip to content

Commit 804b5f0

Browse files
committed
feature #18371 [FrameworkBundle] integrate the Cache component (xabbuh, nicolas-grekas)
This PR was merged into the 3.1-dev branch. Discussion ---------- [FrameworkBundle] integrate the Cache component | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #17537 | License | MIT | Doc PR | - Last commit is the diff with #17868. Commits ------- 4152634 [FrameworkBundle] Add default pool & system adapter 714b916 [FrameworkBundle] Add & use Psr6CacheClearer 4740c5c [FrameworkBundle] use abstract cache.pool decoration and aliases 92b1a20 [FrameworkBundle] Fix and add tests for cache pool wiring e44bfdc [FrameworkBundle] Add cache-pool tag and wiring 281eafa [FrameworkBundle] Integrate the Cache component bc51fde [Cache] Normalize constructor arguments order
2 parents 3ef29c9 + 68efded commit 804b5f0

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

CacheClearer/Psr6CacheClearer.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\HttpKernel\CacheClearer;
13+
14+
use Psr\Cache\CacheItemPoolInterface;
15+
16+
/**
17+
* @author Nicolas Grekas <[email protected]>
18+
*/
19+
class Psr6CacheClearer implements CacheClearerInterface
20+
{
21+
private $pools = array();
22+
23+
public function addPool(CacheItemPoolInterface $pool)
24+
{
25+
$this->pools[] = $pool;
26+
}
27+
28+
/**
29+
* {@inheritdoc}
30+
*/
31+
public function clear($cacheDir)
32+
{
33+
foreach ($this->pools as $pool) {
34+
$pool->clear();
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)