Verzeichnisstruktur phpBB-3.1.0
- Veröffentlicht
- 27.10.2014
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
CacheWarmerAggregate.php
01 <?php
02
03 /*
04 * This file is part of the Symfony package.
05 *
06 * (c) Fabien Potencier <fabien@symfony.com>
07 *
08 * For the full copyright and license information, please view the LICENSE
09 * file that was distributed with this source code.
10 */
11
12 namespace Symfony\Component\HttpKernel\CacheWarmer;
13
14 /**
15 * Aggregates several cache warmers into a single one.
16 *
17 * @author Fabien Potencier <fabien@symfony.com>
18 */
19 class CacheWarmerAggregate implements CacheWarmerInterface
20 {
21 protected $warmers;
22 protected $optionalsEnabled;
23
24 public function __construct(array $warmers = array())
25 {
26 $this->setWarmers($warmers);
27 $this->optionalsEnabled = false;
28 }
29
30 public function enableOptionalWarmers()
31 {
32 $this->optionalsEnabled = true;
33 }
34
35 /**
36 * Warms up the cache.
37 *
38 * @param string $cacheDir The cache directory
39 */
40 public function warmUp($cacheDir)
41 {
42 foreach ($this->warmers as $warmer) {
43 if (!$this->optionalsEnabled && $warmer->isOptional()) {
44 continue;
45 }
46
47 $warmer->warmUp($cacheDir);
48 }
49 }
50
51 /**
52 * Checks whether this warmer is optional or not.
53 *
54 * @return bool always false
55 */
56 public function isOptional()
57 {
58 return false;
59 }
60
61 public function setWarmers(array $warmers)
62 {
63 $this->warmers = array();
64 foreach ($warmers as $warmer) {
65 $this->add($warmer);
66 }
67 }
68
69 public function add(CacheWarmerInterface $warmer)
70 {
71 $this->warmers[] = $warmer;
72 }
73 }
74