Verzeichnisstruktur phpBB-3.3.15


Veröffentlicht
28.08.2024

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.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

CacheWarmerAggregate.php

Zuletzt modifiziert: 02.04.2025, 15:03 - Dateigröße: 2.40 KiB


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   * @final since version 3.4
20   */
21  class CacheWarmerAggregate implements CacheWarmerInterface
22  {
23      protected $warmers = [];
24      protected $optionalsEnabled = false;
25      private $triggerDeprecation = false;
26   
27      public function __construct($warmers = [])
28      {
29          foreach ($warmers as $warmer) {
30              $this->add($warmer);
31          }
32          $this->triggerDeprecation = true;
33      }
34   
35      public function enableOptionalWarmers()
36      {
37          $this->optionalsEnabled = true;
38      }
39   
40      /**
41       * Warms up the cache.
42       *
43       * @param string $cacheDir The cache directory
44       */
45      public function warmUp($cacheDir)
46      {
47          foreach ($this->warmers as $warmer) {
48              if (!$this->optionalsEnabled && $warmer->isOptional()) {
49                  continue;
50              }
51   
52              $warmer->warmUp($cacheDir);
53          }
54      }
55   
56      /**
57       * Checks whether this warmer is optional or not.
58       *
59       * @return bool always false
60       */
61      public function isOptional()
62      {
63          return false;
64      }
65   
66      /**
67       * @deprecated since version 3.4, to be removed in 4.0, inject the list of clearers as a constructor argument instead.
68       */
69      public function setWarmers(array $warmers)
70      {
71          @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0, inject the list of clearers as a constructor argument instead.', __METHOD__), \E_USER_DEPRECATED);
72   
73          $this->warmers = [];
74          foreach ($warmers as $warmer) {
75              $this->add($warmer);
76          }
77      }
78   
79      /**
80       * @deprecated since version 3.4, to be removed in 4.0, inject the list of clearers as a constructor argument instead.
81       */
82      public function add(CacheWarmerInterface $warmer)
83      {
84          if ($this->triggerDeprecation) {
85              @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0, inject the list of clearers as a constructor argument instead.', __METHOD__), \E_USER_DEPRECATED);
86          }
87   
88          $this->warmers[] = $warmer;
89      }
90  }
91