[TASK] Remove leftover FLOW3 code in Caching
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Cache / CacheManager.php
index 549cbfb..dfce814 100644 (file)
@@ -219,125 +219,6 @@ class CacheManager implements \TYPO3\CMS\Core\SingletonInterface
         }
     }
 
-    /**
-     * TYPO3 v4 note: This method is a direct backport from FLOW3 and currently
-     * unused in TYPO3 v4 context.
-     *
-     * Flushes entries tagged with class names if their class source files have changed.
-     * Also flushes AOP proxy caches if a policy was modified.
-     *
-     * This method is used as a slot for a signal sent by the system file monitor
-     * defined in the bootstrap scripts.
-     *
-     * Note: Policy configuration handling is implemented here as well as other parts
-     * of FLOW3 (like the security framework) are not fully initialized at the
-     * time needed.
-     *
-     * @param string $fileMonitorIdentifier Identifier of the File Monitor
-     * @param array $changedFiles A list of full paths to changed files
-     * @return void
-     */
-    public function flushClassFileCachesByChangedFiles($fileMonitorIdentifier, array $changedFiles)
-    {
-        $modifiedClassNamesWithUnderscores = array();
-        $objectClassesCache = $this->getCache('FLOW3_Object_Classes');
-        $objectConfigurationCache = $this->getCache('FLOW3_Object_Configuration');
-        switch ($fileMonitorIdentifier) {
-            case 'FLOW3_ClassFiles':
-                $modifiedAspectClassNamesWithUnderscores = array();
-                foreach ($changedFiles as $pathAndFilename => $status) {
-                    $pathAndFilename = str_replace(FLOW3_PATH_PACKAGES, '', $pathAndFilename);
-                    $matches = array();
-                    if (preg_match('/[^\\/]+\\/(.+)\\/(Classes|Tests)\\/(.+)\\.php/', $pathAndFilename, $matches) === 1) {
-                        $classNameWithUnderscores = str_replace(array('/', '.'), '_', $matches[1] . '_' . ($matches[2] === 'Tests' ? 'Tests_' : '') . $matches[3]);
-                        $modifiedClassNamesWithUnderscores[$classNameWithUnderscores] = true;
-                        // If an aspect was modified, the whole code cache needs to be flushed, so keep track of them:
-                        if (substr($classNameWithUnderscores, -6, 6) === 'Aspect') {
-                            $modifiedAspectClassNamesWithUnderscores[$classNameWithUnderscores] = true;
-                        }
-                        // As long as no modified aspect was found, we are optimistic that only part of the cache needs to be flushed:
-                        if (empty($modifiedAspectClassNamesWithUnderscores)) {
-                            $objectClassesCache->remove($classNameWithUnderscores);
-                        }
-                    }
-                }
-                $flushDoctrineProxyCache = false;
-                if (!empty($modifiedClassNamesWithUnderscores)) {
-                    $reflectionStatusCache = $this->getCache('FLOW3_Reflection_Status');
-                    foreach ($modifiedClassNamesWithUnderscores as $classNameWithUnderscores => $_) {
-                        $reflectionStatusCache->remove($classNameWithUnderscores);
-                        if ($flushDoctrineProxyCache === false && preg_match('/_Domain_Model_(.+)/', $classNameWithUnderscores) === 1) {
-                            $flushDoctrineProxyCache = true;
-                        }
-                    }
-                    $objectConfigurationCache->remove('allCompiledCodeUpToDate');
-                }
-                if (!empty($modifiedAspectClassNamesWithUnderscores)) {
-                    $this->systemLogger->log('Aspect classes have been modified, flushing the whole proxy classes cache.', LOG_INFO);
-                    $objectClassesCache->flush();
-                }
-                if ($flushDoctrineProxyCache === true) {
-                    $this->systemLogger->log('Domain model changes have been detected, triggering Doctrine 2 proxy rebuilding.', LOG_INFO);
-                    $objectConfigurationCache->remove('doctrineProxyCodeUpToDate');
-                }
-                break;
-            case 'FLOW3_ConfigurationFiles':
-                $policyChangeDetected = false;
-                $routesChangeDetected = false;
-                foreach ($changedFiles as $pathAndFilename => $_) {
-                    $filename = basename($pathAndFilename);
-                    if (!in_array($filename, array('Policy.yaml', 'Routes.yaml'))) {
-                        continue;
-                    }
-                    if ($policyChangeDetected === false && $filename === 'Policy.yaml') {
-                        $this->systemLogger->log('The security policies have changed, flushing the policy cache.', LOG_INFO);
-                        $this->getCache('FLOW3_Security_Policy')->flush();
-                        $policyChangeDetected = true;
-                    } elseif ($routesChangeDetected === false && $filename === 'Routes.yaml') {
-                        $this->systemLogger->log('A Routes.yaml file has been changed, flushing the routing cache.', LOG_INFO);
-                        $this->getCache('FLOW3_Mvc_Routing_FindMatchResults')->flush();
-                        $this->getCache('FLOW3_Mvc_Routing_Resolve')->flush();
-                        $routesChangeDetected = true;
-                    }
-                }
-                $this->systemLogger->log('The configuration has changed, triggering an AOP proxy class rebuild.', LOG_INFO);
-                $objectConfigurationCache->remove('allAspectClassesUpToDate');
-                $objectConfigurationCache->remove('allCompiledCodeUpToDate');
-                $objectClassesCache->flush();
-                break;
-            case 'FLOW3_TranslationFiles':
-                foreach ($changedFiles as $pathAndFilename => $status) {
-                    $matches = array();
-                    if (preg_match('/\\/Translations\\/.+\\.xlf/', $pathAndFilename, $matches) === 1) {
-                        $this->systemLogger->log('The localization files have changed, thus flushing the I18n XML model cache.', LOG_INFO);
-                        $this->getCache('FLOW3_I18n_XmlModelCache')->flush();
-                        break;
-                    }
-                }
-                break;
-        }
-    }
-
-    /**
-     * TYPO3 v4 note: This method is a direct backport from FLOW3 and currently
-     * unused in TYPO3 v4 context.
-     *
-     * Renders a tag which can be used to mark a cache entry as "depends on this class".
-     * Whenever the specified class is modified, all cache entries tagged with the
-     * class are flushed.
-     *
-     * If an empty string is specified as class name, the returned tag means
-     * "this cache entry becomes invalid if any of the known classes changes".
-     *
-     * @param string $className The class name
-     * @return string Class Tag
-     * @api
-     */
-    public static function getClassTag($className = '')
-    {
-        return $className === '' ? \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::TAG_CLASS : \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::TAG_CLASS . str_replace('\\', '_', $className);
-    }
-
     /**
      * Instantiates all registered caches.
      *