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. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
ResourceCheckerConfigCacheFactory.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\Config;
13
14 /**
15 * A ConfigCacheFactory implementation that validates the
16 * cache with an arbitrary set of ResourceCheckers.
17 *
18 * @author Matthias Pigulla <mp@webfactory.de>
19 */
20 class ResourceCheckerConfigCacheFactory implements ConfigCacheFactoryInterface
21 {
22 private $resourceCheckers = [];
23
24 /**
25 * @param iterable|ResourceCheckerInterface[] $resourceCheckers
26 */
27 public function __construct($resourceCheckers = [])
28 {
29 $this->resourceCheckers = $resourceCheckers;
30 }
31
32 /**
33 * {@inheritdoc}
34 */
35 public function cache($file, $callback)
36 {
37 if (!\is_callable($callback)) {
38 throw new \InvalidArgumentException(sprintf('Invalid type for callback argument. Expected callable, but got "%s".', \gettype($callback)));
39 }
40
41 $cache = new ResourceCheckerConfigCache($file, $this->resourceCheckers);
42 if (!$cache->isFresh()) {
43 \call_user_func($callback, $cache);
44 }
45
46 return $cache;
47 }
48 }
49