Skip to content

Commit

Permalink
[BUGFIX] Flush DI cache with clear all caches on development context
Browse files Browse the repository at this point in the history
Resolves: #101577
Releases: 12.4, main
Change-Id: If2093146c7066e37881e43ff96c527f5e1efd482
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80356
Tested-by: Benjamin Franzke <ben@bnf.dev>
Reviewed-by: Benjamin Franzke <ben@bnf.dev>
Tested-by: core-ci <typo3@b13.com>
  • Loading branch information
saschanowak authored and bnf committed Aug 4, 2023
1 parent 536b995 commit 35157fb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions typo3/sysext/core/Classes/DataHandling/DataHandler.php
Expand Up @@ -19,6 +19,7 @@
use Doctrine\DBAL\Platforms\PostgreSQL94Platform as PostgreSQLPlatform;
use Doctrine\DBAL\Types\IntegerType;
use Doctrine\DBAL\Types\JsonType;
use Psr\Container\ContainerInterface;
use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
Expand All @@ -35,6 +36,7 @@
use TYPO3\CMS\Core\Configuration\FlexForm\Exception\InvalidPointerFieldValueException;
use TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools;
use TYPO3\CMS\Core\Configuration\Richtext;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Crypto\PasswordHashing\InvalidPasswordHashException;
use TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashFactory;
use TYPO3\CMS\Core\Crypto\Random;
Expand Down Expand Up @@ -9361,6 +9363,12 @@ public function clear_cacheCmd($cacheCmd)

// Delete Opcode Cache
GeneralUtility::makeInstance(OpcodeCacheService::class)->clearAllActive();

// Delete DI Cache only on development context
if (Environment::getContext()->isDevelopment()) {
$container = GeneralUtility::makeInstance(ContainerInterface::class);
$container->get('cache.di')->getBackend()->forceFlush();
}
}
break;
}
Expand Down

0 comments on commit 35157fb

Please sign in to comment.