4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\HttpKernel\CacheClearer;
17 * @author Dustin Dobervich <ddobervich@gmail.com>
19 class ChainCacheClearer implements CacheClearerInterface
27 * Constructs a new instance of ChainCacheClearer.
29 * @param array $clearers The initial clearers
31 public function __construct(array $clearers = array())
33 $this->clearers = $clearers;
39 public function clear($cacheDir)
41 foreach ($this->clearers as $clearer) {
42 $clearer->clear($cacheDir);
47 * Adds a cache clearer to the aggregate.
49 * @param CacheClearerInterface $clearer
51 public function add(CacheClearerInterface $clearer)
53 $this->clearers[] = $clearer;