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

      (Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

ConfigCacheFactory.php

Zuletzt modifiziert: 09.10.2024, 12:54 - Dateigröße: 1.34 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\Config;
 13   
 14  /**
 15   * Basic implementation of ConfigCacheFactoryInterface that
 16   * creates an instance of the default ConfigCache.
 17   *
 18   * This factory and/or cache <em>do not</em> support cache validation
 19   * by means of ResourceChecker instances (that is, service-based).
 20   *
 21   * @author Matthias Pigulla <mp@webfactory.de>
 22   */
 23  class ConfigCacheFactory implements ConfigCacheFactoryInterface
 24  {
 25      /**
 26       * @var bool Debug flag passed to the ConfigCache
 27       */
 28      private $debug;
 29   
 30      /**
 31       * @param bool $debug The debug flag to pass to ConfigCache
 32       */
 33      public function __construct($debug)
 34      {
 35          $this->debug = $debug;
 36      }
 37   
 38      /**
 39       * {@inheritdoc}
 40       */
 41      public function cache($file, $callback)
 42      {
 43          if (!is_callable($callback)) {
 44              throw new \InvalidArgumentException(sprintf('Invalid type for callback argument. Expected callable, but got "%s".', gettype($callback)));
 45          }
 46   
 47          $cache = new ConfigCache($file, $this->debug);
 48          if (!$cache->isFresh()) {
 49              call_user_func($callback, $cache);
 50          }
 51   
 52          return $cache;
 53      }
 54  }
 55