Exemplo n.º 1
0
 /**
  * Constructs the reader, loading parsed data from cache if available.
  *
  * @return void
  */
 public function initializeObject()
 {
     if ($this->cache->has('parsedFormats') && $this->cache->has('parsedFormatsIndices') && $this->cache->has('localizedSymbols')) {
         $this->parsedFormats = $this->cache->get('parsedFormats');
         $this->parsedFormatsIndices = $this->cache->get('parsedFormatsIndices');
         $this->localizedSymbols = $this->cache->get('localizedSymbols');
     }
 }
Exemplo n.º 2
0
 /**
  * When it's called, XML file is parsed (using parser set in $xmlParser)
  * or cache is loaded, if available.
  *
  * @return void
  */
 public function initializeObject()
 {
     if ($this->cache->has(md5($this->sourcePath))) {
         $this->xmlParsedData = $this->cache->get(md5($this->sourcePath));
     } else {
         $this->xmlParsedData = $this->xmlParser->getParsedData($this->sourcePath);
         $this->cache->set(md5($this->sourcePath), $this->xmlParsedData);
     }
 }
Exemplo n.º 3
0
 /**
  * When it's called, CLDR file is parsed or cache is loaded, if available.
  *
  * @return void
  */
 public function initializeObject()
 {
     if ($this->cache->has($this->cacheKey)) {
         $this->parsedData = $this->cache->get($this->cacheKey);
     } else {
         $this->parsedData = $this->parseFiles($this->sourcePaths);
         $this->parsedData = $this->resolveAliases($this->parsedData, '');
         $this->cache->set($this->cacheKey, $this->parsedData);
     }
 }
Exemplo n.º 4
0
 /**
  * Initializes this locale service
  *
  * @return void
  */
 public function initialize()
 {
     $this->configuration = new Configuration($this->settings['defaultLocale']);
     $this->configuration->setFallbackRule($this->settings['fallbackRule']);
     if ($this->cache->has('availableLocales')) {
         $this->localeCollection = $this->cache->get('availableLocales');
     } else {
         $this->generateAvailableLocalesCollectionByScanningFilesystem();
         $this->cache->set('availableLocales', $this->localeCollection);
     }
 }
Exemplo n.º 5
0
 /**
  * Loads reflection data from the cache or reflects the class if needed.
  *
  * If the class is completely unknown, this method won't try to load or reflect
  * it. If it is known and reflection data has been loaded already, it won't be
  * loaded again.
  *
  * In Production context, with frozen caches, this method will load reflection
  * data for the specified class from the runtime cache.
  *
  * @param string $className Name of the class to load data for
  * @return void
  */
 protected function loadOrReflectClassIfNecessary($className)
 {
     if (!isset($this->classReflectionData[$className]) || is_array($this->classReflectionData[$className])) {
         return;
     }
     if ($this->loadFromClassSchemaRuntimeCache === TRUE) {
         $this->classReflectionData[$className] = $this->reflectionDataRuntimeCache->get(str_replace('\\', '_', $className));
     } else {
         $this->reflectClass($className);
     }
 }
Exemplo n.º 6
0
 /**
  * Constructs the reader, loading parsed data from cache if available.
  *
  * @return void
  */
 public function initializeObject()
 {
     if ($this->cache->has('rulesets') && $this->cache->has('rulesetsIndices')) {
         $this->rulesets = $this->cache->get('rulesets');
         $this->rulesetsIndices = $this->cache->get('rulesetsIndices');
     } else {
         $this->generateRulesets();
         $this->cache->set('rulesets', $this->rulesets);
         $this->cache->set('rulesetsIndices', $this->rulesetsIndices);
     }
 }
Exemplo n.º 7
0
 /**
  * Initializes this Policy Service
  *
  * @return void
  */
 public function initializeObject()
 {
     $this->policy = $this->configurationManager->getConfiguration(\TYPO3\FLOW3\Configuration\ConfigurationManager::CONFIGURATION_TYPE_POLICY);
     $this->setAclsForEverybodyRole();
     if ($this->cache->has('acls')) {
         $this->acls = $this->cache->get('acls');
     } else {
         $this->parseEntityAcls();
     }
     if ($this->cache->has('entityResourcesConstraints')) {
         $this->entityResourcesConstraints = $this->cache->get('entityResourcesConstraints');
     } else {
         if (array_key_exists('resources', $this->policy) && array_key_exists('entities', $this->policy['resources'])) {
             $this->entityResourcesConstraints = $this->policyExpressionParser->parseEntityResources($this->policy['resources']['entities']);
         }
     }
 }
Exemplo n.º 8
0
 /**
  * Initializes this strategy
  *
  * @param FileMonitor $fileMonitor
  * @return void
  */
 public function setFileMonitor(FileMonitor $fileMonitor)
 {
     $this->fileMonitor = $fileMonitor;
     $this->filesAndModificationTimes = $this->cache->get($this->fileMonitor->getIdentifier() . '_filesAndModificationTimes');
 }
Exemplo n.º 9
0
 /**
  * Initializes this monitor
  *
  * @return void
  */
 public function initializeObject()
 {
     if ($this->cache->has($this->identifier . '_directoriesAndFiles')) {
         $this->directoriesAndFiles = $this->cache->get($this->identifier . '_directoriesAndFiles');
     }
 }