protected loadClassReflectionCompiletimeCache ( ) : boolean | ||
return | boolean | TRUE if reflection data could be loaded, otherwise FALSE |
protected function loadClassReflectionCompiletimeCache()
{
$data = $this->reflectionDataCompiletimeCache->get('ReflectionData');
if ($data !== false) {
foreach ($data as $propertyName => $propertyValue) {
$this->{$propertyName} = $propertyValue;
}
return true;
}
if (!$this->context->isDevelopment()) {
return false;
}
$useIgBinary = extension_loaded('igbinary');
foreach ($this->packageManager->getActivePackages() as $packageKey => $package) {
if (!$this->packageManager->isPackageFrozen($packageKey)) {
continue;
}
$pathAndFilename = $this->getPrecompiledReflectionStoragePath() . $packageKey . '.dat';
if (!file_exists($pathAndFilename)) {
continue;
}
$data = $useIgBinary ? igbinary_unserialize(file_get_contents($pathAndFilename)) : unserialize(file_get_contents($pathAndFilename));
foreach ($data as $propertyName => $propertyValue) {
$this->{$propertyName} = Arrays::arrayMergeRecursiveOverrule($this->{$propertyName}, $propertyValue);
}
}
return false;
}