Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Improve dependency injection container caching
Disallow disabling and flushing the DI cache and base the cache identifier as well on the currently installed extensions. A disabled DI cache creates an unbearable performance hit, so that disabling won't make sense anyway. Disallowing flushing that cache will not flush the DI cache when caches are flushed using the regular backend UI, but only when caches in install tool are flushed. Last but not least, the install tool cache flushing is changed to not bypass the caching API any more by removing complete caching folders or caching database tables. Instead the CacheManager is now used twice, once with basic caching configuration and a second time with caching configuration that is provided by extensions (if any). Releases: master Resolves: #90418 Change-Id: Idc3d053e181c909ccd662065a9c1ab7a893fa9ac Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63288 Tested-by: TYPO3com <noreply@typo3.com> Tested-by: Georg Ringer <georg.ringer@gmail.com> Tested-by: Benni Mack <benni@typo3.org> Reviewed-by: Georg Ringer <georg.ringer@gmail.com> Reviewed-by: Benni Mack <benni@typo3.org>
- Loading branch information
Showing
7 changed files
with
107 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
typo3/sysext/core/Classes/DependencyInjection/Cache/ContainerBackend.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
declare(strict_types = 1); | ||
namespace TYPO3\CMS\Core\DependencyInjection\Cache; | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
use TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
class ContainerBackend extends SimpleFileBackend | ||
{ | ||
public function flush() | ||
{ | ||
// disable cache flushing | ||
} | ||
|
||
public function set($entryIdentifier, $data, array $tags = [], $lifetime = null) | ||
{ | ||
// Remove stale cache files, once a new DI container was built | ||
parent::flush(); | ||
parent::set($entryIdentifier, $data, $tags, $lifetime); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters