REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 2.38 KB
Close
//opt/cpanel/ea-wappspector/vendor/php-di/php-di/src/Definition/Source/SourceCache.php
Text
Base64
<?php declare(strict_types=1); namespace DI\Definition\Source; use DI\Definition\AutowireDefinition; use DI\Definition\Definition; use DI\Definition\ObjectDefinition; /** * Decorator that caches another definition source. * * @author Matthieu Napoli <matthieu@mnapoli.fr> */ class SourceCache implements DefinitionSource, MutableDefinitionSource { public const CACHE_KEY = 'php-di.definitions.'; public function __construct( private DefinitionSource $cachedSource, private string $cacheNamespace = '', ) { } public function getDefinition(string $name) : ?Definition { $definition = apcu_fetch($this->getCacheKey($name)); if ($definition === false) { $definition = $this->cachedSource->getDefinition($name); // Update the cache if ($this->shouldBeCached($definition)) { apcu_store($this->getCacheKey($name), $definition); } } return $definition; } /** * Used only for the compilation so we can skip the cache safely. */ public function getDefinitions() : array { return $this->cachedSource->getDefinitions(); } public static function isSupported() : bool { return function_exists('apcu_fetch') && ini_get('apc.enabled') && ! ('cli' === \PHP_SAPI && ! ini_get('apc.enable_cli')); } public function getCacheKey(string $name) : string { return self::CACHE_KEY . $this->cacheNamespace . $name; } public function addDefinition(Definition $definition) : void { throw new \LogicException('You cannot set a definition at runtime on a container that has caching enabled. Doing so would risk caching the definition for the next execution, where it might be different. You can either put your definitions in a file, remove the cache or ->set() a raw value directly (PHP object, string, int, ...) instead of a PHP-DI definition.'); } private function shouldBeCached(?Definition $definition = null) : bool { return // Cache missing definitions ($definition === null) // Object definitions are used with `make()` || ($definition instanceof ObjectDefinition) // Autowired definitions cannot be all compiled and are used with `make()` || ($definition instanceof AutowireDefinition); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 11
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
AttributeBasedAutowiring.php
8.59 KB
lrw-r--r--
2025-08-16 11:10:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Autowiring.php
519 B
lrw-r--r--
2025-08-16 11:10:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DefinitionArray.php
3.39 KB
lrw-r--r--
2025-08-16 11:10:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DefinitionFile.php
1.32 KB
lrw-r--r--
2025-08-16 11:10:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DefinitionNormalizer.php
3.67 KB
lrw-r--r--
2025-08-16 11:10:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DefinitionSource.php
633 B
lrw-r--r--
2025-08-16 11:10:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
MutableDefinitionSource.php
356 B
lrw-r--r--
2025-08-16 11:10:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
NoAutowiring.php
579 B
lrw-r--r--
2025-08-16 11:10:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ReflectionBasedAutowiring.php
2.37 KB
lrw-r--r--
2025-08-16 11:10:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
SourceCache.php
2.38 KB
lrw-r--r--
2025-08-16 11:10:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
SourceChain.php
2.63 KB
lrw-r--r--
2025-08-16 11:10:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).