/**
  * Clean the cache and release lock
  *
  * If building the cache for classes failed, we don't know in which state we are. So we need to clear the cache
  * completely and remove the lock which should exist.
  * If the PHP process receives either the SIGTERM or SIGKILL signal, this function will NOT be called.
  * It might still be called on a SIGSEGV signal though, but we can't trust the members of this class then,
  * hence, the contents of $this->* might be nonsense and its usage might lead to undesired behavior.
  *
  * This function needs to be public, so it can be called as shutdown-function, but this function may be changed,
  * renamed or deleted without deprecation, also in bugfix-releases.
  *
  * @return void
  * @internal
  */
 public function checkForCrashAndCleanup()
 {
     // As we are used as shutdownFunction we need to test if we get called while the lock is set.
     // If this is the case, the cache creation has crashed.
     $error = error_get_last();
     // $this->lockObject can be null in installer context without typo3temp, but then this method shouldn't
     // be registered as shutdown-function due to caching being disabled in this case.
     // See @getLocker for more information.
     if ($error !== NULL && $this->lockObject !== NULL && $this->lockObject->getLockStatus()) {
         $this->clearClassesCache();
         $this->releaseLock(TRUE);
     }
 }
 /**
  * Does some processing BEFORE the pagegen script is included.
  *
  * @return void
  * @todo Define visibility
  */
 public function generatePage_preProcessing()
 {
     // Same codeline as in getFromCache(). But $this->all has been changed by t3lib_TStemplate::start() in the meantime, so this must be called again!
     $this->newHash = $this->getHash();
     // For cache management informational purposes.
     $this->config['hash_base'] = $this->hash_base;
     if (!is_object($this->pages_lockObj) || $this->pages_lockObj->getLockStatus() == FALSE) {
         // Here we put some temporary stuff in the cache in order to let the first hit generate the page. The temporary cache will expire after a few seconds (typ. 30) or will be cleared by the rendered page, which will also clear and rewrite the cache.
         $this->tempPageCacheContent();
     }
     // Setting cache_timeout_default. May be overridden by PHP include scritps.
     $this->cacheTimeOutDefault = intval($this->config['config']['cache_period']);
     // Page is generated
     $this->no_cacheBeforePageGen = $this->no_cache;
 }