Skip to content
Snippets Groups Projects
Commit 4f53c04a authored by Nicole Cordes's avatar Nicole Cordes Committed by Anja Leichsenring
Browse files

[BUGFIX] Cache missing class information only in productive context

To improve cache handling during development, missing class information
shouldn't be cached anymore. Otherwise each time a class was misspelled
and not found we have to clear the classes_cache.

Resolves: #61475
Releases: 6.3, 6.2
Change-Id: I7de24348e84bd89afd81164b90f776a996fcb8d9
Reviewed-on: http://review.typo3.org/32685


Reviewed-by: default avatarMarkus Klein <klein.t3@reelworx.at>
Tested-by: default avatarMarkus Klein <klein.t3@reelworx.at>
Reviewed-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
parent cd0661c8
Branches
Tags
No related merge requests found
......@@ -27,6 +27,11 @@ class ClassLoader {
const VALID_CLASSNAME_PATTERN = '/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9\\\\_\x7f-\xff]*$/';
/**
* @var ApplicationContext
*/
protected $context;
/**
* @var ClassAliasMap
*/
......@@ -93,6 +98,7 @@ class ClassLoader {
* @param ApplicationContext $context
*/
public function __construct(ApplicationContext $context) {
$this->context = $context;
$this->classesCache = new Cache\Frontend\StringFrontend('cache_classes', new Cache\Backend\TransientMemoryBackend($context));
}
......@@ -241,8 +247,10 @@ class ClassLoader {
$this->isEarlyCache ? array('early') : array()
);
} elseif (!$this->isEarlyCache) {
// Cache that the class is unknown
$this->classesCache->set($cacheEntryIdentifier, '');
if ($this->context->isProduction()) {
// Cache that the class is unknown
$this->classesCache->set($cacheEntryIdentifier, '');
}
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment