Verzeichnisstruktur phpBB-3.2.0
- Veröffentlicht
- 06.01.2017
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 = array();
22 protected $optionalsEnabled = false;
23
24 public function __construct(array $warmers = array())
25 {
26 foreach ($warmers as $warmer) {
27 $this->add($warmer);
28 }
29 }
30
31 public function enableOptionalWarmers()
32 {
33 $this->optionalsEnabled = true;
34 }
35
36 /**
37 * Warms up the cache.
38 *
39 * @param string $cacheDir The cache directory
40 */
41 public function warmUp($cacheDir)
42 {
43 foreach ($this->warmers as $warmer) {
44 if (!$this->optionalsEnabled && $warmer->isOptional()) {
45 continue;
46 }
47
48 $warmer->warmUp($cacheDir);
49 }
50 }
51
52 /**
53 * Checks whether this warmer is optional or not.
54 *
55 * @return bool always false
56 */
57 public function isOptional()
58 {
59 return false;
60 }
61
62 public function setWarmers(array $warmers)
63 {
64 $this->warmers = array();
65 foreach ($warmers as $warmer) {
66 $this->add($warmer);
67 }
68 }
69
70 public function add(CacheWarmerInterface $warmer)
71 {
72 $this->warmers[] = $warmer;
73 }
74 }
75