Commit cbc4a604 authored by Benni Mack's avatar Benni Mack Committed by Oliver Hader
Browse files

[TASK] Move TYPO3_version constant to a dedicated class

To optimize TYPO3 for Opcaching and speeding up performance,
as well as simplyfing the bootstrap (also for the testing framework)
the constants
* TYPO3_version
* TYPO3_branch
are moved to a new PHP class "Typo3Version".

This reduces the necessity to define the constants, and since
TYPO3 Bootstrap continues to use the class, the constants
are defined in the constructor for TYPO3 v10, and will be removed
in TYPO3 v11.

Resolves: #90007
Releases: master
Change-Id: I18942023c0e234a328d45f724a6b3092c801982c
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62740

Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: Oliver Hader's avatarOliver Hader <oliver.hader@typo3.org>
Reviewed-by: Tymoteusz Motylewski's avatarTymoteusz Motylewski <t.motylewski@gmail.com>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: Oliver Hader's avatarOliver Hader <oliver.hader@typo3.org>
parent 896f47de
......@@ -19,6 +19,7 @@ use TYPO3\CMS\Backend\Module\ModuleLoader;
use TYPO3\CMS\Backend\Template\ModuleTemplate;
use TYPO3\CMS\Core\Http\HtmlResponse;
use TYPO3\CMS\Core\Information\Typo3Copyright;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Package\PackageManager;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Fluid\View\StandaloneView;
......@@ -43,13 +44,19 @@ class AboutController
* @var ViewInterface
*/
protected $view;
/**
* @var Typo3Version
*/
protected $version;
/**
* @var \TYPO3\CMS\Core\Information\Typo3Copyright
*/
private $copyright;
public function __construct(Typo3Copyright $copyright)
public function __construct(Typo3Version $version, Typo3Copyright $copyright)
{
$this->version = $version;
$this->copyright = $copyright;
}
......@@ -74,7 +81,7 @@ class AboutController
$this->view->assignMultiple([
'copyrightYear' => $this->copyright->getCopyrightYear(),
'donationUrl' => TYPO3_URL_DONATE,
'currentVersion' => TYPO3_version,
'currentVersion' => $this->version->getVersion(),
'loadedExtensions' => $this->getLoadedExtensions(),
'copyRightNotice' => $this->copyright->getCopyrightNotice(),
'warnings' => $warnings,
......
......@@ -21,13 +21,13 @@ use TYPO3\CMS\Backend\Toolbar\Enumeration\InformationStatus;
use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Routing\RouteNotFoundException;
use TYPO3\CMS\Core\Utility\CommandUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\StringUtility;
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
use TYPO3\CMS\Fluid\View\StandaloneView;
/**
......@@ -76,9 +76,15 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
*/
protected $maximumCountInBadge = 99;
/**
* @var Typo3Version
*/
protected $typo3Version;
public function __construct(EventDispatcherInterface $eventDispatcher = null)
{
$this->eventDispatcher = $eventDispatcher ?? GeneralUtility::getContainer()->get(EventDispatcherInterface::class);
$this->typo3Version = GeneralUtility::makeInstance(Typo3Version::class);
$this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/Toolbar/SystemInformationMenu');
$this->highestSeverity = InformationStatus::cast(InformationStatus::STATUS_INFO);
}
......@@ -240,7 +246,7 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
{
$this->systemInformation[] = [
'title' => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:toolbarItems.sysinfo.typo3-version',
'value' => VersionNumberUtility::getCurrentTypo3Version(),
'value' => $this->typo3Version->getVersion(),
'iconIdentifier' => 'information-typo3-version'
];
}
......@@ -321,7 +327,7 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
*/
protected function getGitRevision()
{
if (!StringUtility::endsWith(TYPO3_version, '-dev') || $this->isFunctionDisabled('exec')) {
if (!StringUtility::endsWith($this->typo3Version->getVersion(), '-dev') || $this->isFunctionDisabled('exec')) {
return;
}
// check if git exists
......
......@@ -25,6 +25,7 @@ use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use TYPO3\CMS\Core\Http\HtmlResponse;
use TYPO3\CMS\Core\Http\JsonResponse;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Type\Bitmask\Permission;
use TYPO3\CMS\Core\Type\File\ImageInfo;
......@@ -88,6 +89,11 @@ class BackendController
*/
protected $iconFactory;
/**
* @var Typo3Version
*/
protected $typo3Version;
/**
* Constructor
*/
......@@ -98,6 +104,7 @@ class BackendController
$this->backendModuleRepository = GeneralUtility::makeInstance(BackendModuleRepository::class);
$this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
$this->typo3Version = GeneralUtility::makeInstance(Typo3Version::class);
// Set debug flag for BE development only
$this->debug = (int)$GLOBALS['TYPO3_CONF_VARS']['BE']['debug'] === 1;
// Initializes the backend modules structure for use later.
......@@ -219,7 +226,8 @@ class BackendController
$this->generateJavascript();
// Set document title:
$title = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] ? $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] . ' [TYPO3 CMS ' . TYPO3_version . ']' : 'TYPO3 CMS ' . TYPO3_version;
$typo3Version = 'TYPO3 CMS ' . $this->typo3Version->getVersion();
$title = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] ? $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] . ' [' . $typo3Version . ']' : $typo3Version;
// Renders the module page
$this->content = GeneralUtility::makeInstance(DocumentTemplate::class)->render($title, $view->render());
$hookConfiguration = ['content' => &$this->content];
......@@ -266,7 +274,7 @@ class BackendController
$view->assign('logoUrl', PathUtility::getAbsoluteWebPath($logoPath));
$view->assign('logoWidth', $logoWidth);
$view->assign('logoHeight', $logoHeight);
$view->assign('applicationVersion', TYPO3_version);
$view->assign('applicationVersion', $this->typo3Version->getVersion());
$view->assign('siteName', $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']);
$view->assign('toolbar', $this->renderToolbar());
......@@ -379,7 +387,7 @@ class BackendController
navFrameHighlightedID: [], // used by navigation frames to track which row id was highlighted last time
currentBank: "0"
};
top.goToModule = function(modName, cMR_flag, addGetVars) {
TYPO3.ModuleMenu.App.showModule(modName, addGetVars);
}
......
......@@ -27,6 +27,7 @@ use TYPO3\CMS\Core\Context\WorkspaceAspect;
use TYPO3\CMS\Core\Core\ApplicationInterface;
use TYPO3\CMS\Core\Core\Bootstrap;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
......@@ -52,7 +53,7 @@ class CommandApplication implements ApplicationInterface
$this->checkEnvironmentOrDie();
$this->application = new Application('TYPO3 CMS', sprintf(
'%s (Application Context: <comment>%s</comment>)',
TYPO3_version,
(new Typo3Version())->getVersion(),
Environment::getContext()
));
$this->application->setAutoExit(false);
......
......@@ -23,6 +23,7 @@ use Symfony\Component\Console\Output\ConsoleOutput;
use TYPO3\CMS\Core\Authentication\CommandLineUserAuthentication;
use TYPO3\CMS\Core\Core\Bootstrap;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
......@@ -46,7 +47,7 @@ class CommandRequestHandler implements RequestHandlerInterface
trigger_error('CommandRequestHandler will be removed in TYPO3 v11.0, as CLI is executed inside the CommandApplication directly.', E_USER_DEPRECATED);
$this->application = new Application('TYPO3 CMS', sprintf(
'%s (Application Context: <comment>%s</comment>)',
TYPO3_version,
(new Typo3Version())->getVersion(),
Environment::getContext()
));
}
......
......@@ -30,6 +30,7 @@ use TYPO3\CMS\Core\Cache\Frontend\VariableFrontend;
use TYPO3\CMS\Core\Configuration\ConfigurationManager;
use TYPO3\CMS\Core\DependencyInjection\ContainerBuilder;
use TYPO3\CMS\Core\Imaging\IconRegistry;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\IO\PharStreamWrapperInterceptor;
use TYPO3\CMS\Core\Log\LogManager;
use TYPO3\CMS\Core\Package\FailsafePackageManager;
......@@ -535,7 +536,7 @@ class Bootstrap
public static function initializeBackendRouter()
{
// See if the Routes.php from all active packages have been built together already
$cacheIdentifier = 'BackendRoutesFromPackages_' . sha1(TYPO3_version . Environment::getProjectPath() . 'BackendRoutesFromPackages');
$cacheIdentifier = 'BackendRoutesFromPackages_' . sha1((string)(new Typo3Version()) . Environment::getProjectPath() . 'BackendRoutesFromPackages');
/** @var \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $codeCache */
$codeCache = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Cache\CacheManager::class)->getCache('core');
......
......@@ -100,13 +100,10 @@ class SystemEnvironmentBuilder
{
// Check one of the constants and return early if already defined,
// needed if multiple requests are handled in one process, for instance in functional testing.
if (defined('TYPO3_version')) {
if (defined('TYPO3_copyright_year')) {
return;
}
// This version, branch and copyright
define('TYPO3_version', '10.3.0-dev');
define('TYPO3_branch', '10.3');
define('TYPO3_copyright_year', '1998-' . date('Y'));
// TYPO3 external links
......
......@@ -23,6 +23,7 @@ use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Package\PackageManager;
/**
......@@ -178,6 +179,6 @@ class ContainerBuilder
*/
protected function createCacheIdentifier(): string
{
return $this->cacheIdentifier = 'DependencyInjectionContainer_' . sha1(TYPO3_version . Environment::getProjectPath() . 'DependencyInjectionContainer');
return $this->cacheIdentifier = 'DependencyInjectionContainer_' . sha1((string)(new Typo3Version()) . Environment::getProjectPath() . 'DependencyInjectionContainer');
}
}
......@@ -17,14 +17,17 @@ namespace TYPO3\CMS\Core\ExpressionLanguage;
*/
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Utility\GeneralUtility;
class SiteConditionProvider extends AbstractProvider
{
public function __construct()
{
$typo3 = new \stdClass();
$typo3->version = TYPO3_version;
$typo3->branch = TYPO3_branch;
$typo3Version = GeneralUtility::makeInstance(Typo3Version::class);
$typo3->version = $typo3Version->getVersion();
$typo3->branch = $typo3Version->getBranch();
$typo3->devIpMask = trim($GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask']);
$this->expressionLanguageVariables = [
'applicationContext' => (string)Environment::getContext(),
......
......@@ -18,6 +18,7 @@ namespace TYPO3\CMS\Core\ExpressionLanguage;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\ExpressionLanguage\FunctionsProvider\Typo3ConditionFunctionsProvider;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
......@@ -30,8 +31,9 @@ class TypoScriptConditionProvider extends AbstractProvider
public function __construct()
{
$typo3 = new \stdClass();
$typo3->version = TYPO3_version;
$typo3->branch = TYPO3_branch;
$typo3Version = GeneralUtility::makeInstance(Typo3Version::class);
$typo3->version = $typo3Version->getVersion();
$typo3->branch = $typo3Version->getBranch();
$typo3->devIpMask = trim($GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask']);
$this->expressionLanguageVariables = [
'request' => GeneralUtility::makeInstance(RequestWrapper::class, $GLOBALS['TYPO3_REQUEST'] ?? null),
......
......@@ -19,6 +19,7 @@ use ArrayObject;
use Psr\Container\ContainerInterface;
use TYPO3\CMS\Core\Cache\Frontend\PhpFrontend as PhpFrontendCache;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Service\DependencyOrderingService;
/**
......@@ -130,6 +131,6 @@ class MiddlewareStackResolver
*/
protected function getCacheIdentifier(string $stackName): string
{
return 'middlewares_' . $stackName . '_' . sha1(TYPO3_version . Environment::getProjectPath());
return 'middlewares_' . $stackName . '_' . sha1((string)(new Typo3Version()) . Environment::getProjectPath());
}
}
......@@ -22,6 +22,7 @@ use TYPO3\CMS\Core\Exception;
use TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider;
use TYPO3\CMS\Core\Imaging\IconProvider\FontawesomeIconProvider;
use TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\SingletonInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\StringUtility;
......@@ -503,7 +504,7 @@ class IconRegistry implements SingletonInterface
*/
protected function getCachedBackendIcons()
{
$cacheIdentifier = 'BackendIcons_' . sha1(TYPO3_version . Environment::getProjectPath() . 'BackendIcons');
$cacheIdentifier = 'BackendIcons_' . sha1((string)(new Typo3Version()) . Environment::getProjectPath() . 'BackendIcons');
/** @var \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend $assetsCache */
$assetsCache = static::$cache ?? GeneralUtility::makeInstance(CacheManager::class)->getCache('assets');
$cacheEntry = $assetsCache->get($cacheIdentifier);
......
<?php
namespace TYPO3\CMS\Install\ViewHelpers;
declare(strict_types = 1);
namespace TYPO3\CMS\Core\Information;
/*
* This file is part of the TYPO3 CMS project.
......@@ -14,38 +15,47 @@ namespace TYPO3\CMS\Install\ViewHelpers;
* The TYPO3 project - inspiring people to share!
*/
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
/**
* Render value of a constant
*
* @internal
*/
class ConstantViewHelper extends AbstractViewHelper
class Typo3Version
{
use CompileWithRenderStatic;
protected const VERSION = '10.3.0-dev';
protected const BRANCH = '10.3';
/**
* Initialize arguments
* Define constants used up until TYPO3 v10, this constructor can be removed in TYPO3 v11.
*/
public function initializeArguments()
public function __construct()
{
$this->registerArgument('name', 'string', 'Name of the constant', true);
if (!defined('TYPO3_version')) {
define('TYPO3_version', $this->getVersion());
}
if (!defined('TYPO3_branch')) {
define('TYPO3_branch', $this->getBranch());
}
}
public function getVersion(): string
{
return static::VERSION;
}
public function getBranch(): string
{
return static::BRANCH;
}
/**
* Render a constant
*
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* Get 'major version' of version, e.g., '7' from '7.3.0'
*
* @return string Value of constant
* @return int Major version, e.g., '7'
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
public function getMajorVersion(): int
{
[$explodedVersion] = explode('.', static::VERSION);
return (int)$explodedVersion;
}
public function __toString(): string
{
return constant($arguments['name']);
return $this->getVersion();
}
}
......@@ -19,6 +19,7 @@ use Symfony\Component\Finder\SplFileInfo;
use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface;
use TYPO3\CMS\Core\Core\ClassLoadingInformation;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Service\DependencyOrderingService;
use TYPO3\CMS\Core\Service\OpcodeCacheService;
use TYPO3\CMS\Core\SingletonInterface;
......@@ -143,7 +144,7 @@ class PackageManager implements SingletonInterface
if ($this->cacheIdentifier === null) {
$mTime = @filemtime($this->packageStatesPathAndFilename);
if ($mTime !== false) {
$this->cacheIdentifier = md5(TYPO3_version . $this->packageStatesPathAndFilename . $mTime);
$this->cacheIdentifier = md5((string)(new Typo3Version()) . $this->packageStatesPathAndFilename . $mTime);
} else {
$this->cacheIdentifier = null;
}
......
......@@ -24,6 +24,7 @@ use TYPO3\CMS\Core\Category\CategoryRegistry;
use TYPO3\CMS\Core\Configuration\Event\AfterTcaCompilationEvent;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Imaging\IconRegistry;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Log\LogManager;
use TYPO3\CMS\Core\Migrations\TcaMigration;
use TYPO3\CMS\Core\Package\PackageManager;
......@@ -1505,7 +1506,7 @@ tt_content.' . $key . $suffix . ' {
*/
protected static function getExtLocalconfCacheIdentifier()
{
return 'ext_localconf_' . sha1(TYPO3_version . Environment::getProjectPath() . 'extLocalconf' . serialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['runtimeActivatedPackages']));
return 'ext_localconf_' . sha1((string)(new Typo3Version()) . Environment::getProjectPath() . 'extLocalconf' . serialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['runtimeActivatedPackages']));
}
/**
......@@ -1643,7 +1644,7 @@ tt_content.' . $key . $suffix . ' {
*/
protected static function getBaseTcaCacheIdentifier()
{
return 'tca_base_' . sha1(TYPO3_version . Environment::getProjectPath() . 'tca_code' . serialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['runtimeActivatedPackages']));
return 'tca_base_' . sha1((string)(new Typo3Version()) . Environment::getProjectPath() . 'tca_code' . serialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['runtimeActivatedPackages']));
}
/**
......@@ -1729,7 +1730,7 @@ tt_content.' . $key . $suffix . ' {
*/
protected static function getExtTablesCacheIdentifier()
{
return 'ext_tables_' . sha1(TYPO3_version . Environment::getProjectPath() . 'extTables' . serialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['runtimeActivatedPackages']));
return 'ext_tables_' . sha1((string)(new Typo3Version()) . Environment::getProjectPath() . 'extTables' . serialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['runtimeActivatedPackages']));
}
/**
......
......@@ -14,6 +14,8 @@ namespace TYPO3\CMS\Core\Utility;
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Core\Information\Typo3Version;
/**
* Class with helper functions for version number handling
*/
......@@ -119,7 +121,7 @@ class VersionNumberUtility
*/
public static function getCurrentTypo3Version()
{
return TYPO3_version;
return (string)GeneralUtility::makeInstance(Typo3Version::class);
}
/**
......
.. include:: ../../Includes.txt
=====================================================================
Deprecation: #90007 - Global constants TYPO3_version and TYPO3_branch
=====================================================================
See :issue:`90007`
Description
===========
Two of the most "stable" global constants in the TYPO3 Core - `TYPO3_version` and `TYPO3_branch` have been marked as deprecated.
The change was mainly driven by the necessity to minimize runtime-generated constants in order to optimize performance, also for op-caching.
The same information is available in a new PHP class :php:`TYPO3\CMS\Core\Information\Typo3Version`, which also defines
the constants for backwards-compatibility reasons.
Impact
======
No :php:`E_USER_DEPRECATED` error is triggered, however the constants will work during
TYPO3 v10, and be removed with TYPO3 v11.
Affected Installations
======================
TYPO3 installations with custom extensions accessing the constants,
which is common for having extension support for multiple TYPO3 versions.
Migration
=========
It is highly recommended to use the :php:`Typo3Version` class instead of
the constants, as they will removed.
Check the Extension Scanner in the Upgrade section of TYPO3 to see
if any extensions you use might be affected.
.. index:: PHP-API, FullyScanned, ext:core
\ No newline at end of file
......@@ -20,6 +20,7 @@ use TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException;
use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface;
use TYPO3\CMS\Core\Cache\Frontend\NullFrontend;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Package\PackageManager;
use TYPO3\CMS\Core\SingletonInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
......@@ -61,7 +62,7 @@ final class RequestHandlersConfigurationFactory implements SingletonInterface
*/
public function createRequestHandlersConfiguration(): RequestHandlersConfiguration
{
$cacheEntryIdentifier = 'RequestHandlers_' . sha1(TYPO3_version . Environment::getProjectPath());
$cacheEntryIdentifier = 'RequestHandlers_' . sha1((string)(new Typo3Version()) . Environment::getProjectPath());
if ($this->cacheFrontend->has($cacheEntryIdentifier)) {
return new RequestHandlersConfiguration($this->cacheFrontend->get($cacheEntryIdentifier));
......
......@@ -19,6 +19,7 @@ use TYPO3\CMS\Core\Cache\CacheManager;
use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface;
use TYPO3\CMS\Core\Cache\Frontend\NullFrontend;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Package\PackageManager;
use TYPO3\CMS\Core\SingletonInterface;
use TYPO3\CMS\Core\Utility\ArrayUtility;
......@@ -61,7 +62,7 @@ final class ClassesConfigurationFactory implements SingletonInterface
*/
public function createClassesConfiguration(): ClassesConfiguration
{
$cacheEntryIdentifier = 'PersistenceClasses_' . sha1(TYPO3_version . Environment::getProjectPath());
$cacheEntryIdentifier = 'PersistenceClasses_' . sha1((new Typo3Version())->getVersion() . Environment::getProjectPath());
if ($this->cacheFrontend->has($cacheEntryIdentifier)) {
return new ClassesConfiguration($this->cacheFrontend->get($cacheEntryIdentifier));
......
......@@ -18,6 +18,7 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic\Mapper;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Database\Query\QueryHelper;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Extbase\Persistence\ClassesConfiguration;
use TYPO3\CMS\Extbase\Persistence\ClassesConfigurationFactory;
use TYPO3\CMS\Extbase\Reflection\ClassSchema\Exception\NoSuchPropertyException;
......@@ -102,7 +103,7 @@ class DataMapFactory implements \TYPO3\CMS\Core\SingletonInterface
return $this->dataMaps[$className];
}
$cacheIdentifierClassName = str_replace('\\', '', $className);
$cacheIdentifier = 'DataMap_' . $cacheIdentifierClassName . '_' . sha1(TYPO3_version . Environment::getProjectPath());
$cacheIdentifier = 'DataMap_' . $cacheIdentifierClassName . '_' . sha1((string)(new Typo3Version()) . Environment::getProjectPath());
$dataMap = $this->dataMapCache->get($cacheIdentifier);
if ($dataMap === false) {
$dataMap = $this->buildDataMapInternal($className);
......
Supports Markdown
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