Loads PHP code from the cache and require_onces it right away.
public requireOnce ( string $entryIdentifier ) : mixed | ||
$entryIdentifier | string | An identifier which describes the cache entry to load |
Результат | mixed | Potential return value from the include operation |
/** * Gets an entry from the cache or NULL if the * entry does not exist. * * @param string $name * @return string */ public function get($name) { if ($this->flowCache->has($name)) { $this->flowCache->requireOnce($name); } return $this->flowCache->getWrapped($name); }
/** * This object is created very early and is part of the blacklisted "Neos\Flow\Aop" namespace so we can't rely on AOP for the property injection. * * @param ObjectManagerInterface $objectManager * @return void */ public function injectObjectManager(ObjectManagerInterface $objectManager) { if ($this->objectManager === null) { $this->objectManager = $objectManager; /** @var CacheManager $cacheManager */ $cacheManager = $this->objectManager->get(CacheManager::class); $this->runtimeExpressionsCache = $cacheManager->getCache('Flow_Aop_RuntimeExpressions'); $this->runtimeExpressions = $this->runtimeExpressionsCache->requireOnce('Flow_Aop_RuntimeExpressions'); } }
/** * Loads php files containing classes or interfaces found in the classes directory of * a package and specifically registered classes. * * @param string $className Name of the class/interface to load * @return boolean */ public function loadClass($className) { if ($className[0] === '\\') { $className = ltrim($className, '\\'); } $namespaceParts = explode('\\', $className); // Workaround for Doctrine's annotation parser which does a class_exists() for annotations like "@param" and so on: if (isset($this->ignoredClassNames[$className]) || isset($this->ignoredClassNames[end($namespaceParts)]) || isset($this->nonExistentClasses[$className])) { return false; } // Loads any known proxied class: if ($this->classesCache !== null && ($this->availableProxyClasses === null || isset($this->availableProxyClasses[implode('_', $namespaceParts)])) && $this->classesCache->requireOnce(implode('_', $namespaceParts)) !== false) { return true; } $classNamePart = array_pop($namespaceParts); $classNameParts = explode('_', $classNamePart); $namespaceParts = array_merge($namespaceParts, $classNameParts); $namespacePartCount = count($namespaceParts); $currentPackageArray = $this->packageNamespaces; $packagenamespacePartCount = 0; // This will contain all possible class mappings for the given class name. We start with the fallback paths and prepend mappings with growing specificy. $collectedPossibleNamespaceMappings = [['p' => $this->fallbackClassPaths, 'c' => 0]]; if ($namespacePartCount > 1) { while ($packagenamespacePartCount + 1 < $namespacePartCount) { $possiblePackageNamespacePart = $namespaceParts[$packagenamespacePartCount]; if (!isset($currentPackageArray[$possiblePackageNamespacePart])) { break; } $packagenamespacePartCount++; $currentPackageArray = $currentPackageArray[$possiblePackageNamespacePart]; if (isset($currentPackageArray['_pathData'])) { array_unshift($collectedPossibleNamespaceMappings, ['p' => $currentPackageArray['_pathData'], 'c' => $packagenamespacePartCount]); } } } foreach ($collectedPossibleNamespaceMappings as $nameSpaceMapping) { if ($this->loadClassFromPossiblePaths($nameSpaceMapping['p'], $namespaceParts, $nameSpaceMapping['c'])) { return true; } } $this->nonExistentClasses[$className] = true; return false; }
/** * Initialize the Evaluator */ public function initializeObject() { $this->expressionCache->requireOnce('cachedExpressionClosures'); }