diff --git a/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst b/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst index 0b12e49fc4987db74f2a133684f3e7664e9f9bdf..7265965d8289169f3df3326c563dd8a59424f476 100644 --- a/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst +++ b/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst @@ -27,6 +27,7 @@ The following PHP classes that have previously been marked as deprecated for v11 - :php:`\TYPO3\CMS\Extbase\Domain\Repository\CategoryRepository` - :php:`\TYPO3\CMS\Extbase\Domain\Repository\FrontendUserGroupRepository` - :php:`\TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository` +- :php:`\TYPO3\CMS\Extbase\Service\EnvironmentService` The following PHP interfaces that have previously been marked as deprecated for v11 and were now removed: diff --git a/typo3/sysext/extbase/Classes/Service/EnvironmentService.php b/typo3/sysext/extbase/Classes/Service/EnvironmentService.php deleted file mode 100644 index cf7893a6cb1cfc130c5149afc06759d193d6da34..0000000000000000000000000000000000000000 --- a/typo3/sysext/extbase/Classes/Service/EnvironmentService.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php - -declare(strict_types=1); - -/* - * 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! - */ - -namespace TYPO3\CMS\Extbase\Service; - -use Psr\Http\Message\ServerRequestInterface; -use TYPO3\CMS\Core\Http\ApplicationType; -use TYPO3\CMS\Core\SingletonInterface; - -/** - * Service for determining environment params - * @internal only to be used within Extbase, not part of TYPO3 Core API. - * @deprecated since v11.2, will be removed in v12.0. - */ -class EnvironmentService implements SingletonInterface -{ - /** - * @var bool|null - */ - protected $isFrontendMode; - - public function __construct() - { - trigger_error(__CLASS__ . ' will be removed in TYPO3 v12, use the PSR-7 Request and the ApplicationType instead.', E_USER_DEPRECATED); - } - - /** - * Detects if frontend application has been called. - * - * @return bool - */ - public function isEnvironmentInFrontendMode(): bool - { - $this->initialize(); - if ($this->isFrontendMode !== null) { - return $this->isFrontendMode; - } - // Frontend mode stays false if backend or cli without request object - return ($GLOBALS['TYPO3_REQUEST'] ?? null) instanceof ServerRequestInterface - && ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isFrontend(); - } - - /** - * Detects if backend application has been called. - * - * @return bool - */ - public function isEnvironmentInBackendMode(): bool - { - return !$this->isEnvironmentInFrontendMode(); - } - - protected function initialize(): void - { - if ($this->isFrontendMode !== null) { - return; - } - // Frontend mode stays false if backend or cli without request object - $this->isFrontendMode = ($GLOBALS['TYPO3_REQUEST'] ?? null) instanceof ServerRequestInterface - && ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isFrontend(); - } - - /** - * A helper method for tests to simulate application behavior, should only be used within TYPO3 Core - * - * @param bool $isFrontendMode - * @internal only used for testing purposes and can be removed at any time. - */ - public function setFrontendMode(bool $isFrontendMode): void - { - $this->isFrontendMode = $isFrontendMode; - } -} diff --git a/typo3/sysext/extbase/Classes/ServiceProvider.php b/typo3/sysext/extbase/Classes/ServiceProvider.php index 06433bc958b107f7224f66a286dca3f77b7575fc..924076a53f1fbaa3e925578e38396448d3beffae 100644 --- a/typo3/sysext/extbase/Classes/ServiceProvider.php +++ b/typo3/sysext/extbase/Classes/ServiceProvider.php @@ -47,8 +47,6 @@ class ServiceProvider extends AbstractServiceProvider Configuration\BackendConfigurationManager::class => [ static::class, 'getBackendConfigurationManager' ], Configuration\ConfigurationManager::class => [ static::class, 'getConfigurationManager' ], Reflection\ReflectionService::class => [ static::class, 'getReflectionService' ], - // @deprecated since v11, will be removed in v12 - Service\EnvironmentService::class => [ static::class, 'getEnvironmentService' ], Service\ExtensionService::class => [ static::class, 'getExtensionService' ], Service\ImageService::class => [ static::class, 'getImageService' ], Security\Cryptography\HashService::class => [ static::class, 'getHashService' ], @@ -97,14 +95,6 @@ class ServiceProvider extends AbstractServiceProvider return self::new($container, Reflection\ReflectionService::class, [$container->get(CacheManager::class)->getCache('extbase'), $container->get(PackageDependentCacheIdentifier::class)->withPrefix('ClassSchemata')->toString()]); } - /** - * @deprecated since v11, will be removed in v12 - */ - public static function getEnvironmentService(ContainerInterface $container): Service\EnvironmentService - { - return self::new($container, Service\EnvironmentService::class); - } - public static function getExtensionService(ContainerInterface $container): Service\ExtensionService { $extensionService = self::new($container, Service\ExtensionService::class); diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php index cd2948bcd8939f530e8f68699996c23a3952c841..2c435d116310277dd6c0eb5cb81f92db0fbe7d10 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php @@ -1624,6 +1624,7 @@ return [ 'TYPO3\CMS\Extbase\Service\EnvironmentService' => [ 'restFiles' => [ 'Deprecation-92494-ExtbaseEnvironmentService.rst', + 'Breaking-96107-DeprecatedFunctionalityRemoved.rst', ], ], 'TYPO3\CMS\Backend\ViewHelpers\ModuleLayoutViewHelper' => [