diff --git a/typo3/sysext/backend/Classes/Backend/Avatar/Avatar.php b/typo3/sysext/backend/Classes/Backend/Avatar/Avatar.php index 3c4b12c95bae26b560d39e878138d1994b8e0801..599af0ccefa007294201deb7d37db4ec6532629e 100644 --- a/typo3/sysext/backend/Classes/Backend/Avatar/Avatar.php +++ b/typo3/sysext/backend/Classes/Backend/Avatar/Avatar.php @@ -17,6 +17,8 @@ declare(strict_types=1); namespace TYPO3\CMS\Backend\Backend\Avatar; +use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; use TYPO3\CMS\Core\Imaging\IconFactory; @@ -31,6 +33,7 @@ use TYPO3\CMS\Core\Utility\PathUtility; * * See render() and getImgTag() as main entry points */ +#[Autoconfigure(public: true)] class Avatar { /** @@ -41,6 +44,7 @@ class Avatar protected array $avatarProviders = []; public function __construct( + #[Autowire(service: 'cache.runtime')] protected readonly FrontendInterface $cache, protected readonly DependencyOrderingService $dependencyOrderingService, protected readonly IconFactory $iconFactory diff --git a/typo3/sysext/backend/Classes/Middleware/ContentSecurityPolicyHeaders.php b/typo3/sysext/backend/Classes/Middleware/ContentSecurityPolicyHeaders.php index 5a6a0e9fb594301ccd7e326a36f6220449cff0e5..0fdf4c59bb0edc528f130dfad150ec7fd52b5483 100644 --- a/typo3/sysext/backend/Classes/Middleware/ContentSecurityPolicyHeaders.php +++ b/typo3/sysext/backend/Classes/Middleware/ContentSecurityPolicyHeaders.php @@ -22,6 +22,7 @@ use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface; use Psr\Log\LoggerInterface; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; use TYPO3\CMS\Core\Core\RequestId; use TYPO3\CMS\Core\Security\ContentSecurityPolicy\PolicyProvider; @@ -33,13 +34,14 @@ use TYPO3\CMS\Core\Security\ContentSecurityPolicy\UriValue; * * @internal */ -final class ContentSecurityPolicyHeaders implements MiddlewareInterface +final readonly class ContentSecurityPolicyHeaders implements MiddlewareInterface { public function __construct( - private readonly RequestId $requestId, - private readonly LoggerInterface $logger, - private readonly FrontendInterface $cache, - private readonly PolicyProvider $policyProvider, + private RequestId $requestId, + private LoggerInterface $logger, + #[Autowire(service: 'cache.assets')] + private FrontendInterface $cache, + private PolicyProvider $policyProvider, ) {} public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface diff --git a/typo3/sysext/backend/Configuration/Services.yaml b/typo3/sysext/backend/Configuration/Services.yaml index d6e7ca22b0b768079e73d80eb9c32720a1fbd5d7..f2a4b230e97980c1576bb72475128c8485fd8772 100644 --- a/typo3/sysext/backend/Configuration/Services.yaml +++ b/typo3/sysext/backend/Configuration/Services.yaml @@ -15,15 +15,6 @@ services: tags: - { name: 'console.command', command: 'backend:user:create', description: 'Create a backend user', schedulable: false } - TYPO3\CMS\Backend\Middleware\ContentSecurityPolicyHeaders: - arguments: - $cache: '@cache.assets' - - TYPO3\CMS\Backend\Backend\Avatar\Avatar: - public: true - arguments: - $cache: '@cache.runtime' - TYPO3\CMS\Backend\Authentication\PasswordReset: public: true diff --git a/typo3/sysext/core/Classes/Configuration/Extension/ExtLocalconfFactory.php b/typo3/sysext/core/Classes/Configuration/Extension/ExtLocalconfFactory.php index 12ce2591033e6993c4a45d0bf48018ac3f6e563a..346282e4b9823fe32c59eff063ba29203cabe7ca 100644 --- a/typo3/sysext/core/Classes/Configuration/Extension/ExtLocalconfFactory.php +++ b/typo3/sysext/core/Classes/Configuration/Extension/ExtLocalconfFactory.php @@ -17,6 +17,8 @@ declare(strict_types=1); namespace TYPO3\CMS\Core\Configuration\Extension; +use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use TYPO3\CMS\Core\Cache\Frontend\PhpFrontend; use TYPO3\CMS\Core\Package\Cache\PackageDependentCacheIdentifier; use TYPO3\CMS\Core\Package\PackageManager; @@ -24,11 +26,13 @@ use TYPO3\CMS\Core\Package\PackageManager; /** * @internal Bootstrap related ext_localconf loading. Extensions must not use this. */ -final class ExtLocalconfFactory +#[Autoconfigure(public: true)] +final readonly class ExtLocalconfFactory { public function __construct( - private readonly PackageManager $packageManager, - private readonly PhpFrontend $codeCache, + private PackageManager $packageManager, + #[Autowire(service: 'cache.core')] + private PhpFrontend $codeCache, ) {} /** diff --git a/typo3/sysext/core/Classes/Configuration/Extension/ExtTablesFactory.php b/typo3/sysext/core/Classes/Configuration/Extension/ExtTablesFactory.php index f19173fe80e4c66af7c381832c0c0271fd738e40..c27c5e88d026e7bc72006c63b1d358158ec4e4f2 100644 --- a/typo3/sysext/core/Classes/Configuration/Extension/ExtTablesFactory.php +++ b/typo3/sysext/core/Classes/Configuration/Extension/ExtTablesFactory.php @@ -17,6 +17,8 @@ declare(strict_types=1); namespace TYPO3\CMS\Core\Configuration\Extension; +use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use TYPO3\CMS\Core\Cache\Frontend\PhpFrontend; use TYPO3\CMS\Core\Package\Cache\PackageDependentCacheIdentifier; use TYPO3\CMS\Core\Package\PackageManager; @@ -24,11 +26,13 @@ use TYPO3\CMS\Core\Package\PackageManager; /** * @internal Bootstrap related ext_tables loading. Extensions must not use this. */ -final class ExtTablesFactory +#[Autoconfigure(public: true)] +final readonly class ExtTablesFactory { public function __construct( - private readonly PackageManager $packageManager, - private readonly PhpFrontend $codeCache, + private PackageManager $packageManager, + #[Autowire(service: 'cache.core')] + private PhpFrontend $codeCache, ) {} /** diff --git a/typo3/sysext/core/Classes/Configuration/Tca/TcaFactory.php b/typo3/sysext/core/Classes/Configuration/Tca/TcaFactory.php index 7b96f160854a5bcb9a653f1bb481296d3d7a2217..904755cf91ea4b982ce89b359d438ea22f95828f 100644 --- a/typo3/sysext/core/Classes/Configuration/Tca/TcaFactory.php +++ b/typo3/sysext/core/Classes/Configuration/Tca/TcaFactory.php @@ -18,6 +18,8 @@ declare(strict_types=1); namespace TYPO3\CMS\Core\Configuration\Tca; use Psr\EventDispatcher\EventDispatcherInterface; +use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use Symfony\Component\Finder\Finder; use TYPO3\CMS\Core\Cache\Frontend\PhpFrontend; use TYPO3\CMS\Core\Configuration\Event\AfterTcaCompilationEvent; @@ -30,12 +32,14 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; /** * @internal Bootstrap related base TCA loading. Extensions must not use this. */ -final class TcaFactory +#[Autoconfigure(public: true)] +final readonly class TcaFactory { public function __construct( - private readonly PackageManager $packageManager, - private readonly EventDispatcherInterface $eventDispatcher, - private readonly PhpFrontend $codeCache, + private PackageManager $packageManager, + private EventDispatcherInterface $eventDispatcher, + #[Autowire(service: 'cache.core')] + private PhpFrontend $codeCache, ) {} /** diff --git a/typo3/sysext/core/Classes/DataHandling/SoftReference/SoftReferenceParserFactory.php b/typo3/sysext/core/Classes/DataHandling/SoftReference/SoftReferenceParserFactory.php index f9dd4d9b1efb7137858ae7d7283a69a3cb547f77..6bcf5bc96b6e9b0f7a9e4c7c1b52a268fa9fefe9 100644 --- a/typo3/sysext/core/Classes/DataHandling/SoftReference/SoftReferenceParserFactory.php +++ b/typo3/sysext/core/Classes/DataHandling/SoftReference/SoftReferenceParserFactory.php @@ -18,23 +18,21 @@ declare(strict_types=1); namespace TYPO3\CMS\Core\DataHandling\SoftReference; use Psr\Log\LoggerInterface; +use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; use TYPO3\CMS\Core\Utility\GeneralUtility; -/** - * Factory class for soft reference parsers - */ +#[Autoconfigure(public: true)] class SoftReferenceParserFactory { protected array $softReferenceParsers = []; - protected FrontendInterface $runtimeCache; - protected LoggerInterface $logger; - public function __construct(FrontendInterface $runtimeCache, LoggerInterface $logger) - { - $this->runtimeCache = $runtimeCache; - $this->logger = $logger; - } + public function __construct( + #[Autowire(service: 'cache.runtime')] + protected readonly FrontendInterface $runtimeCache, + protected readonly LoggerInterface $logger, + ) {} /** * Adds a parser via DI. @@ -116,9 +114,6 @@ class SoftReferenceParserFactory * tags: * - name: softreference.parser * parserKey: userdefined - * - * - * @param string $softReferenceParserKey */ public function getSoftReferenceParser(string $softReferenceParserKey): SoftReferenceParserInterface { diff --git a/typo3/sysext/core/Classes/ExpressionLanguage/ProviderConfigurationLoader.php b/typo3/sysext/core/Classes/ExpressionLanguage/ProviderConfigurationLoader.php index d7a32afedcb9d7f1ddb5ae5eaa1be8d40ef5ace3..06e89a81c99376576fa64461ea6580ef1eb9b25c 100644 --- a/typo3/sysext/core/Classes/ExpressionLanguage/ProviderConfigurationLoader.php +++ b/typo3/sysext/core/Classes/ExpressionLanguage/ProviderConfigurationLoader.php @@ -17,6 +17,8 @@ declare(strict_types=1); namespace TYPO3\CMS\Core\ExpressionLanguage; +use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use TYPO3\CMS\Core\Attribute\AsEventListener; use TYPO3\CMS\Core\Cache\Event\CacheWarmupEvent; use TYPO3\CMS\Core\Cache\Frontend\PhpFrontend; @@ -25,12 +27,15 @@ use TYPO3\CMS\Core\Package\PackageManager; /** * This class resolves the expression language provider configuration and store in a cache. */ -class ProviderConfigurationLoader +#[Autoconfigure(public: true)] +readonly class ProviderConfigurationLoader { public function __construct( - private readonly PackageManager $packageManager, - private readonly PhpFrontend $coreCache, - private readonly string $cacheIdentifier, + private PackageManager $packageManager, + #[Autowire(service: 'cache.core')] + private PhpFrontend $coreCache, + #[Autowire(expression: 'service("package-dependent-cache-identifier").withPrefix("ExpressionLanguageProviders").toString()')] + private string $cacheIdentifier, ) {} public function getExpressionLanguageProviders(): array diff --git a/typo3/sysext/core/Classes/Page/ImportMapFactory.php b/typo3/sysext/core/Classes/Page/ImportMapFactory.php index 7a16d696f614037a3b092e3444f78e8f15ac1c11..fe96cb8604b14ee33fdd35e3f3aa2a1140348a34 100644 --- a/typo3/sysext/core/Classes/Page/ImportMapFactory.php +++ b/typo3/sysext/core/Classes/Page/ImportMapFactory.php @@ -18,18 +18,23 @@ declare(strict_types=1); namespace TYPO3\CMS\Core\Page; use Psr\EventDispatcher\EventDispatcherInterface; +use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; use TYPO3\CMS\Core\Crypto\HashService; use TYPO3\CMS\Core\Package\PackageManager; use TYPO3\CMS\Core\SingletonInterface; +#[Autoconfigure(public: true)] class ImportMapFactory implements SingletonInterface { public function __construct( private readonly HashService $hashService, private readonly PackageManager $packageManager, + #[Autowire(service: 'cache.assets')] private readonly FrontendInterface $assetsCache, private readonly EventDispatcherInterface $eventDispatcher, + #[Autowire(expression: 'service("package-dependent-cache-identifier").withPrefix("ImportMap").toString()')] private readonly string $cacheIdentifier, ) {} diff --git a/typo3/sysext/core/Classes/Page/PageRenderer.php b/typo3/sysext/core/Classes/Page/PageRenderer.php index cd34638667bd142f538c6f5515d988576e9c8602..cf15801bcd101c9ccb11beb1e6f60b9b45d4980f 100644 --- a/typo3/sysext/core/Classes/Page/PageRenderer.php +++ b/typo3/sysext/core/Classes/Page/PageRenderer.php @@ -19,6 +19,7 @@ use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\StreamFactoryInterface; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use TYPO3\CMS\Backend\Routing\Router; use TYPO3\CMS\Backend\Routing\UriBuilder; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; @@ -122,6 +123,7 @@ class PageRenderer implements SingletonInterface protected bool $applyNonceHint = false; public function __construct( + #[Autowire(service: 'cache.assets')] protected readonly FrontendInterface $assetsCache, protected readonly MarkerBasedTemplateService $templateService, protected readonly MetaTagManagerRegistry $metaTagRegistry, @@ -133,7 +135,6 @@ class PageRenderer implements SingletonInterface protected readonly StreamFactoryInterface $streamFactory, ) { $this->reset(); - $this->setMetaTag('name', 'generator', 'TYPO3 CMS'); } diff --git a/typo3/sysext/core/Classes/Service/MarkerBasedTemplateService.php b/typo3/sysext/core/Classes/Service/MarkerBasedTemplateService.php index 30b3cf8ce15189f3869d83432cc17065a3c0e8d8..3805ae16589575f275edd24adf20c6d81f74d5ab 100644 --- a/typo3/sysext/core/Classes/Service/MarkerBasedTemplateService.php +++ b/typo3/sysext/core/Classes/Service/MarkerBasedTemplateService.php @@ -15,6 +15,8 @@ namespace TYPO3\CMS\Core\Service; +use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; @@ -23,11 +25,14 @@ use TYPO3\CMS\Core\Utility\MathUtility; * Helper functionality for subparts and marker substitution * ###MYMARKER### */ -class MarkerBasedTemplateService +#[Autoconfigure(public: true)] +readonly class MarkerBasedTemplateService { public function __construct( - protected readonly FrontendInterface $hashCache, - protected readonly FrontendInterface $runtimeCache, + #[Autowire(service: 'cache.assets')] + protected FrontendInterface $hashCache, + #[Autowire(service: 'cache.runtime')] + protected FrontendInterface $runtimeCache, ) {} /** diff --git a/typo3/sysext/core/Classes/TypoScript/PageTsConfigFactory.php b/typo3/sysext/core/Classes/TypoScript/PageTsConfigFactory.php index 3c482198af868e1b1a54e33088af9c2f5017df40..04ad2a0089dfe9f0cfbd81471f8054079c0d8b35 100644 --- a/typo3/sysext/core/Classes/TypoScript/PageTsConfigFactory.php +++ b/typo3/sysext/core/Classes/TypoScript/PageTsConfigFactory.php @@ -18,6 +18,8 @@ declare(strict_types=1); namespace TYPO3\CMS\Core\TypoScript; use Psr\Container\ContainerInterface; +use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Cache\Frontend\PhpFrontend; use TYPO3\CMS\Core\Site\Entity\Site; @@ -40,13 +42,15 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; * * @internal Internal for now until API stabilized. Use BackendUtility::getPagesTSconfig(). */ -final class PageTsConfigFactory +#[Autoconfigure(public: true)] +final readonly class PageTsConfigFactory { public function __construct( - private readonly ContainerInterface $container, - private readonly TokenizerInterface $tokenizer, - private readonly TsConfigTreeBuilder $tsConfigTreeBuilder, - private readonly PhpFrontend $cache, + private ContainerInterface $container, + private TokenizerInterface $tokenizer, + private TsConfigTreeBuilder $tsConfigTreeBuilder, + #[Autowire(service: 'cache.typoscript')] + private PhpFrontend $cache, ) {} public function create( diff --git a/typo3/sysext/core/Classes/TypoScript/UserTsConfigFactory.php b/typo3/sysext/core/Classes/TypoScript/UserTsConfigFactory.php index 07a8880a6d067f1d73602eb7d67bb92f53d8fe85..bc92cc0c350ed095682b285f6595b1c82879491c 100644 --- a/typo3/sysext/core/Classes/TypoScript/UserTsConfigFactory.php +++ b/typo3/sysext/core/Classes/TypoScript/UserTsConfigFactory.php @@ -18,6 +18,8 @@ declare(strict_types=1); namespace TYPO3\CMS\Core\TypoScript; use Psr\Container\ContainerInterface; +use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Cache\Frontend\PhpFrontend; use TYPO3\CMS\Core\TypoScript\IncludeTree\Traverser\ConditionVerdictAwareIncludeTreeTraverser; @@ -34,13 +36,15 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; * * @internal Internal for now until API stabilized. Use backendUser->getTSConfig(). */ -final class UserTsConfigFactory +#[Autoconfigure(public: true)] +final readonly class UserTsConfigFactory { public function __construct( - private readonly ContainerInterface $container, - private readonly TokenizerInterface $tokenizer, - private readonly TsConfigTreeBuilder $tsConfigTreeBuilder, - private readonly PhpFrontend $cache, + private ContainerInterface $container, + private TokenizerInterface $tokenizer, + private TsConfigTreeBuilder $tsConfigTreeBuilder, + #[Autowire(service: 'cache.typoscript')] + private PhpFrontend $cache, ) {} public function create(BackendUserAuthentication $backendUser): UserTsConfig diff --git a/typo3/sysext/core/Configuration/Services.yaml b/typo3/sysext/core/Configuration/Services.yaml index 9a4932dbbda7624e4c4b1638e3b7b08bb37d3647..4ce9b6228c43d03effd41a1d4d49e3b8ebb0e0d7 100644 --- a/typo3/sysext/core/Configuration/Services.yaml +++ b/typo3/sysext/core/Configuration/Services.yaml @@ -7,8 +7,8 @@ services: TYPO3\CMS\Core\: resource: '../Classes/*' # glob for services that have been previously available as - # container entries and have been removed in the mean time - # (e.g. because factories are to be used instead) + # container entries and have been removed in the meantime, + # e.g. because factories are to be used instead. exclude: '../Classes/{Localization/LanguageService.php}' TYPO3\CMS\Core\DependencyInjection\EnvVarProcessor: @@ -182,56 +182,20 @@ services: - name: softreference.parser parserKey: url - TYPO3\CMS\Core\DataHandling\SoftReference\SoftReferenceParserFactory: - public: true - arguments: - $runtimeCache: '@cache.runtime' - - TYPO3\CMS\Core\Configuration\Extension\ExtLocalconfFactory: - public: true - arguments: - $codeCache: '@cache.core' - - TYPO3\CMS\Core\Configuration\Extension\ExtTablesFactory: - public: true - arguments: - $codeCache: '@cache.core' - - TYPO3\CMS\Core\Configuration\Tca\TcaFactory: - public: true - arguments: - $codeCache: '@cache.core' - TYPO3\CMS\Core\ExpressionLanguage\DefaultProvider: public: true - TYPO3\CMS\Core\ExpressionLanguage\ProviderConfigurationLoader: - public: true - arguments: - $coreCache: '@cache.core' - $cacheIdentifier: '@=service("TYPO3\\CMS\\Core\\Package\\Cache\\PackageDependentCacheIdentifier").withPrefix("ExpressionLanguageProviders").toString()' - TYPO3\CMS\Core\Locking\ResourceMutex: public: true TYPO3\CMS\Core\Page\PageLayoutResolver: public: true - TYPO3\CMS\Core\Page\PageRenderer: - arguments: - $assetsCache: '@cache.assets' - TYPO3\CMS\Core\Page\AssetRenderer: public: true arguments: $eventDispatcher: '@Psr\EventDispatcher\EventDispatcherInterface' - TYPO3\CMS\Core\Page\ImportMapFactory: - public: true - arguments: - $assetsCache: '@cache.assets' - $cacheIdentifier: '@=service("TYPO3\\CMS\\Core\\Package\\Cache\\PackageDependentCacheIdentifier").withPrefix("ImportMap").toString()' - TYPO3\CMS\Core\Resource\FileRepository: public: true @@ -253,12 +217,6 @@ services: TYPO3\CMS\Core\Domain\Access\RecordAccessVoter: public: true - TYPO3\CMS\Core\Service\MarkerBasedTemplateService: - public: true - arguments: - $hashCache: '@cache.assets' - $runtimeCache: '@cache.runtime' - TYPO3\CMS\Core\TypoScript\AST\AstBuilderInterface: alias: TYPO3\CMS\Core\TypoScript\AST\AstBuilder @@ -305,16 +263,6 @@ services: TYPO3\CMS\Core\TypoScript\Tokenizer\TokenizerInterface: alias: TYPO3\CMS\Core\TypoScript\Tokenizer\LossyTokenizer - TYPO3\CMS\Core\TypoScript\PageTsConfigFactory: - public: true - arguments: - $cache: '@cache.typoscript' - - TYPO3\CMS\Core\TypoScript\UserTsConfigFactory: - public: true - arguments: - $cache: '@cache.typoscript' - TYPO3\CMS\Core\Utility\DiffUtility: shared: false @@ -457,8 +405,8 @@ services: alias: GuzzleHttp\Client public: true Symfony\Contracts\EventDispatcher\EventDispatcherInterface: - alias: TYPO3\CMS\Core\Adapter\EventDispatcherAdapter - public: true + alias: TYPO3\CMS\Core\Adapter\EventDispatcherAdapter + public: true TYPO3\CMS\Core\Mail\MailerInterface: alias: TYPO3\CMS\Core\Mail\Mailer public: true diff --git a/typo3/sysext/dashboard/Classes/Widgets/RssWidget.php b/typo3/sysext/dashboard/Classes/Widgets/RssWidget.php index c635496a746ea19ff27e7e1e5da3831c119ede94..b02b57b00def43c55cb375795a925c17c7f9855a 100644 --- a/typo3/sysext/dashboard/Classes/Widgets/RssWidget.php +++ b/typo3/sysext/dashboard/Classes/Widgets/RssWidget.php @@ -18,8 +18,9 @@ declare(strict_types=1); namespace TYPO3\CMS\Dashboard\Widgets; use Psr\Http\Message\ServerRequestInterface; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use TYPO3\CMS\Backend\View\BackendViewFactory; -use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface as Cache; +use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -46,7 +47,8 @@ class RssWidget implements WidgetInterface, RequestAwareWidgetInterface public function __construct( private readonly WidgetConfigurationInterface $configuration, - private readonly Cache $cache, + #[Autowire(service: 'cache.dashboard.rss')] + private readonly FrontendInterface $cache, private readonly BackendViewFactory $backendViewFactory, private readonly ?ButtonProviderInterface $buttonProvider = null, array $options = [], diff --git a/typo3/sysext/dashboard/Configuration/Backend/DashboardWidgets.yaml b/typo3/sysext/dashboard/Configuration/Backend/DashboardWidgets.yaml index 4b2bb336fbbc82e75d17b42f2eab4ef482fb3776..ec77f4b93430ac1ffc3574c673421e6081836007 100644 --- a/typo3/sysext/dashboard/Configuration/Backend/DashboardWidgets.yaml +++ b/typo3/sysext/dashboard/Configuration/Backend/DashboardWidgets.yaml @@ -58,7 +58,6 @@ services: dashboard.widget.t3news: class: 'TYPO3\CMS\Dashboard\Widgets\RssWidget' arguments: - $cache: '@cache.dashboard.rss' $buttonProvider: '@dashboard.buttons.t3news' $options: feedUrl: 'https://typo3.org/rss' @@ -162,7 +161,6 @@ services: dashboard.widget.t3securityAdvisories: class: 'TYPO3\CMS\Dashboard\Widgets\RssWidget' arguments: - $cache: '@cache.dashboard.rss' $buttonProvider: '@dashboard.buttons.t3securityAdvisories' $options: feedUrl: 'https://typo3.org/rss-security' diff --git a/typo3/sysext/dashboard/Documentation/Configuration/WidgetRegistration.rst b/typo3/sysext/dashboard/Documentation/Configuration/WidgetRegistration.rst index 0d2c81cbd93bb904d0d336a66076eacd2d1f9f5c..0c1970a4687e2d6ab1f78afc857cf4787009cdae 100644 --- a/typo3/sysext/dashboard/Documentation/Configuration/WidgetRegistration.rst +++ b/typo3/sysext/dashboard/Documentation/Configuration/WidgetRegistration.rst @@ -53,7 +53,6 @@ the following service registration can be used inside of :file:`Configuration/Se class: 'TYPO3\CMS\Dashboard\Widgets\RssWidget' arguments: $buttonProvider: '@dashboard.buttons.t3news' - $cache: '@cache.dashboard.rss' $options: feedUrl: 'https://www.typo3.org/rss' tags: @@ -207,7 +206,6 @@ An example to split up all Widget related configuration would look like: class: 'TYPO3\CMS\Dashboard\Widgets\RssWidget' arguments: $buttonProvider: '@dashboard.buttons.t3news' - $cache: '@cache.dashboard.rss' $options: feedUrl: 'https://www.typo3.org/rss' tags: diff --git a/typo3/sysext/dashboard/Documentation/Developer/MakeRefreshable.rst b/typo3/sysext/dashboard/Documentation/Developer/MakeRefreshable.rst index dab6ffde96e61461c43e81207ed8a4c6c6fc6f3c..6c3c64365241e4a5c7ed8506493b4d3bd25e3b1b 100644 --- a/typo3/sysext/dashboard/Documentation/Developer/MakeRefreshable.rst +++ b/typo3/sysext/dashboard/Documentation/Developer/MakeRefreshable.rst @@ -21,7 +21,6 @@ registration. Below is an example of a RSS widget with the refresh option enable dashboard.widget.myOwnRSSWidget: class: 'TYPO3\CMS\Dashboard\Widgets\RssWidget' arguments: - $cache: '@cache.dashboard.rss' $options: rssFile: 'https://typo3.org/rss' lifeTime: 43200 diff --git a/typo3/sysext/dashboard/Documentation/Widgets/RssWidget.rst b/typo3/sysext/dashboard/Documentation/Widgets/RssWidget.rst index 6262ecf667f036911b54e4d27ad996e9cf776d5a..09dbd3d2909c832f5c810c76621fce9438691e29 100644 --- a/typo3/sysext/dashboard/Documentation/Widgets/RssWidget.rst +++ b/typo3/sysext/dashboard/Documentation/Widgets/RssWidget.rst @@ -36,7 +36,6 @@ Example dashboard.widget.t3news: class: 'TYPO3\CMS\Dashboard\Widgets\RssWidget' arguments: - $cache: '@cache.dashboard.rss' $buttonProvider: '@dashboard.buttons.t3news' $options: feedUrl: 'https://www.typo3.org/rss' @@ -86,8 +85,3 @@ Dependencies This button should be provided by a ButtonProvider that implements the interface :php:`ButtonProviderInterface`. See :ref:`adding-buttons` for further info and configuration options. - -.. option:: $cache - - Used to cache fetched RSS items. - This should not be changed. diff --git a/typo3/sysext/extbase/Classes/Configuration/BackendConfigurationManager.php b/typo3/sysext/extbase/Classes/Configuration/BackendConfigurationManager.php index be00ce11c4493cca97ad0ab4a671aca0d2b5c24c..71d2dfad31ba808313386aaa3b97b631432dce52 100644 --- a/typo3/sysext/extbase/Classes/Configuration/BackendConfigurationManager.php +++ b/typo3/sysext/extbase/Classes/Configuration/BackendConfigurationManager.php @@ -18,6 +18,8 @@ declare(strict_types=1); namespace TYPO3\CMS\Extbase\Configuration; use Psr\Http\Message\ServerRequestInterface; +use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; use TYPO3\CMS\Core\Cache\Frontend\PhpFrontend; @@ -65,6 +67,7 @@ use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; * * @internal only to be used within Extbase, not part of TYPO3 Core API. */ +#[Autoconfigure(public: true)] class BackendConfigurationManager implements SingletonInterface { /** @@ -95,7 +98,9 @@ class BackendConfigurationManager implements SingletonInterface public function __construct( private readonly TypoScriptService $typoScriptService, + #[Autowire(service: 'cache.typoscript')] private readonly PhpFrontend $typoScriptCache, + #[Autowire(service: 'cache.runtime')] private readonly FrontendInterface $runtimeCache, private readonly SysTemplateRepository $sysTemplateRepository, private readonly SiteFinder $siteFinder, diff --git a/typo3/sysext/extbase/Classes/Persistence/ClassesConfigurationFactory.php b/typo3/sysext/extbase/Classes/Persistence/ClassesConfigurationFactory.php index 409038b0b71be2fb2d95b6bc35f00e108e7e65fc..ceeb646ba630a9f4b4c519b3e59893536691fae7 100644 --- a/typo3/sysext/extbase/Classes/Persistence/ClassesConfigurationFactory.php +++ b/typo3/sysext/extbase/Classes/Persistence/ClassesConfigurationFactory.php @@ -17,26 +17,22 @@ declare(strict_types=1); namespace TYPO3\CMS\Extbase\Persistence; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; use TYPO3\CMS\Core\Package\PackageManager; use TYPO3\CMS\Core\Utility\ArrayUtility; use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; use TYPO3\CMS\Extbase\DomainObject\AbstractValueObject; -final class ClassesConfigurationFactory +final readonly class ClassesConfigurationFactory { - private FrontendInterface $cache; - - private PackageManager $packageManager; - - private string $cacheIdentifier; - - public function __construct(FrontendInterface $cache, PackageManager $packageManager, string $cacheIdentifier) - { - $this->cache = $cache; - $this->packageManager = $packageManager; - $this->cacheIdentifier = $cacheIdentifier; - } + public function __construct( + #[Autowire(service: 'cache.extbase')] + private FrontendInterface $cache, + private PackageManager $packageManager, + #[Autowire(expression: 'service("package-dependent-cache-identifier").withPrefix("PersistenceClasses").toString()')] + private string $cacheIdentifier, + ) {} public function createClassesConfiguration(): ClassesConfiguration { diff --git a/typo3/sysext/extbase/Configuration/Services.yaml b/typo3/sysext/extbase/Configuration/Services.yaml index ed4bcaa462bc034ca8f64070a26e4b396cc8a3b0..09077e2c826f595b9ef83179b96467d906c40143 100644 --- a/typo3/sysext/extbase/Configuration/Services.yaml +++ b/typo3/sysext/extbase/Configuration/Services.yaml @@ -11,12 +11,6 @@ services: public: true shared: false - TYPO3\CMS\Extbase\Configuration\BackendConfigurationManager: - public: true - arguments: - $typoScriptCache: '@cache.typoscript' - $runtimeCache: '@cache.runtime' - # formerly in EXT:extbase/ext_localconf.php TYPO3\CMS\Extbase\Persistence\QueryInterface: alias: TYPO3\CMS\Extbase\Persistence\Generic\Query @@ -75,11 +69,6 @@ services: TYPO3\CMS\Extbase\Persistence\ClassesConfiguration: factory: ['@TYPO3\CMS\Extbase\Persistence\ClassesConfigurationFactory', 'createClassesConfiguration'] - TYPO3\CMS\Extbase\Persistence\ClassesConfigurationFactory: - arguments: - $cache: '@cache.extbase' - $cacheIdentifier: '@=service("TYPO3\\CMS\\Core\\Package\\Cache\\PackageDependentCacheIdentifier").withPrefix("PersistenceClasses").toString()' - TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory: arguments: $baseCacheIdentifier: '@=service("TYPO3\\CMS\\Core\\Package\\Cache\\PackageDependentCacheIdentifier").toString()' diff --git a/typo3/sysext/form/Classes/Service/TranslationService.php b/typo3/sysext/form/Classes/Service/TranslationService.php index 3a98cd962d639c649c2588e7376be14bec4ae9af..28fdac63bc2c84aa0623237347d7df3480847a5a 100644 --- a/typo3/sysext/form/Classes/Service/TranslationService.php +++ b/typo3/sysext/form/Classes/Service/TranslationService.php @@ -18,6 +18,8 @@ declare(strict_types=1); namespace TYPO3\CMS\Form\Service; use Psr\Http\Message\ServerRequestInterface; +use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; use TYPO3\CMS\Core\Http\ApplicationType; use TYPO3\CMS\Core\Localization\LanguageService; @@ -41,6 +43,7 @@ use TYPO3\CMS\Form\Domain\Runtime\FormRuntime; * Scope: frontend / backend * @internal */ +#[Autoconfigure(public: true)] class TranslationService implements SingletonInterface { /** @@ -53,6 +56,7 @@ class TranslationService implements SingletonInterface public function __construct( protected readonly ConfigurationManagerInterface $configurationManager, protected readonly LanguageServiceFactory $languageServiceFactory, + #[Autowire(service: 'cache.runtime')] protected readonly FrontendInterface $runtimeCache, protected readonly Locales $locales ) {} diff --git a/typo3/sysext/form/Configuration/Services.yaml b/typo3/sysext/form/Configuration/Services.yaml index be1eda8110285edffdd3e8226c409a97edd0f095..0277b54f1ac8ef270f473814bef4180f7cac539c 100644 --- a/typo3/sysext/form/Configuration/Services.yaml +++ b/typo3/sysext/form/Configuration/Services.yaml @@ -19,11 +19,6 @@ services: alias: TYPO3\CMS\Form\Mvc\Persistence\FormPersistenceManager public: true - TYPO3\CMS\Form\Service\TranslationService: - public: true - arguments: - $runtimeCache: '@cache.runtime' - TYPO3\CMS\Form\Domain\Factory\ArrayFormFactory: public: true shared: false diff --git a/typo3/sysext/frontend/Classes/Cache/CacheLifetimeCalculator.php b/typo3/sysext/frontend/Classes/Cache/CacheLifetimeCalculator.php index 06e830a2a6daa5c69d1b627ef72802323316237b..c79b7f3afba6f16667e5c45e3d25fec6f16c24b4 100644 --- a/typo3/sysext/frontend/Classes/Cache/CacheLifetimeCalculator.php +++ b/typo3/sysext/frontend/Classes/Cache/CacheLifetimeCalculator.php @@ -18,6 +18,8 @@ declare(strict_types=1); namespace TYPO3\CMS\Frontend\Cache; use Psr\EventDispatcher\EventDispatcherInterface; +use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; use TYPO3\CMS\Core\Context\Context; use TYPO3\CMS\Core\Database\Connection; @@ -35,11 +37,13 @@ use TYPO3\CMS\Frontend\Event\ModifyCacheLifetimeForPageEvent; * * @internal This class is not part of the TYPO3 Core API */ +#[Autoconfigure(public: true)] class CacheLifetimeCalculator { protected int $defaultCacheTimeout = 86400; public function __construct( + #[Autowire(service: 'cache.runtime')] protected readonly FrontendInterface $runtimeCache, protected readonly EventDispatcherInterface $eventDispatcher, protected readonly ConnectionPool $connectionPool diff --git a/typo3/sysext/frontend/Classes/Middleware/ContentSecurityPolicyHeaders.php b/typo3/sysext/frontend/Classes/Middleware/ContentSecurityPolicyHeaders.php index ccd7c51059a14a1818007d9cf8480886f0367733..85b96326b9c4556aa0b6036be8436584aeda1d20 100644 --- a/typo3/sysext/frontend/Classes/Middleware/ContentSecurityPolicyHeaders.php +++ b/typo3/sysext/frontend/Classes/Middleware/ContentSecurityPolicyHeaders.php @@ -22,6 +22,7 @@ use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface; use Psr\Log\LoggerInterface; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; use TYPO3\CMS\Core\Configuration\Features; use TYPO3\CMS\Core\Core\RequestId; @@ -34,14 +35,15 @@ use TYPO3\CMS\Core\Security\ContentSecurityPolicy\UriValue; * * @internal */ -final class ContentSecurityPolicyHeaders implements MiddlewareInterface +final readonly class ContentSecurityPolicyHeaders implements MiddlewareInterface { public function __construct( - private readonly Features $features, - private readonly RequestId $requestId, - private readonly LoggerInterface $logger, - private readonly FrontendInterface $cache, - private readonly PolicyProvider $policyProvider, + private Features $features, + private RequestId $requestId, + private LoggerInterface $logger, + #[Autowire(service: 'cache.assets')] + private FrontendInterface $cache, + private PolicyProvider $policyProvider, ) {} public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface diff --git a/typo3/sysext/frontend/Classes/Middleware/PrepareTypoScriptFrontendRendering.php b/typo3/sysext/frontend/Classes/Middleware/PrepareTypoScriptFrontendRendering.php index 636de88afdfcc01c1f708eb99870ce1d688e5012..602ad672a495f217744625b253615ff57094b0f0 100644 --- a/typo3/sysext/frontend/Classes/Middleware/PrepareTypoScriptFrontendRendering.php +++ b/typo3/sysext/frontend/Classes/Middleware/PrepareTypoScriptFrontendRendering.php @@ -23,6 +23,7 @@ use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface; use Psr\Log\LoggerInterface; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; use TYPO3\CMS\Core\Cache\Frontend\PhpFrontend; use TYPO3\CMS\Core\Context\Context; @@ -49,7 +50,9 @@ final readonly class PrepareTypoScriptFrontendRendering implements MiddlewareInt public function __construct( private EventDispatcherInterface $eventDispatcher, private FrontendTypoScriptFactory $frontendTypoScriptFactory, + #[Autowire(service: 'cache.typoscript')] private PhpFrontend $typoScriptCache, + #[Autowire(service: 'cache.pages')] private FrontendInterface $pageCache, private ResourceMutex $lock, private Context $context, diff --git a/typo3/sysext/frontend/Classes/Typolink/LinkFactory.php b/typo3/sysext/frontend/Classes/Typolink/LinkFactory.php index 2170e268d5762a60d7243c41407770c485af89e5..a174eaaa89b1d5f6e652647a0f9a6ab7e64bfd61 100644 --- a/typo3/sysext/frontend/Classes/Typolink/LinkFactory.php +++ b/typo3/sysext/frontend/Classes/Typolink/LinkFactory.php @@ -20,6 +20,8 @@ namespace TYPO3\CMS\Frontend\Typolink; use Psr\EventDispatcher\EventDispatcherInterface; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerAwareTrait; +use Symfony\Component\DependencyInjection\Attribute\Autoconfigure; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; use TYPO3\CMS\Core\LinkHandling\Exception\UnknownLinkHandlerException; use TYPO3\CMS\Core\LinkHandling\LinkService; @@ -36,6 +38,7 @@ use TYPO3\CMS\Frontend\Event\AfterLinkIsGeneratedEvent; * Main class for generating any kind of frontend links. * Contains all logic for the infamous typolink() functionality. */ +#[Autoconfigure(public: true)] class LinkFactory implements LoggerAwareInterface { use DefaultJavaScriptAssetTrait; @@ -45,6 +48,7 @@ class LinkFactory implements LoggerAwareInterface protected readonly LinkService $linkService, protected readonly EventDispatcherInterface $eventDispatcher, protected readonly TypoLinkCodecService $typoLinkCodecService, + #[Autowire(service: 'cache.runtime')] protected readonly FrontendInterface $runtimeCache, protected readonly SiteFinder $siteFinder, ) {} diff --git a/typo3/sysext/frontend/Configuration/Services.yaml b/typo3/sysext/frontend/Configuration/Services.yaml index ca7c6b0120ffc7f2552079c95643179cae6cd468..ec363a55bfff3a40e26764a23cbad6ad8fe54aa4 100644 --- a/typo3/sysext/frontend/Configuration/Services.yaml +++ b/typo3/sysext/frontend/Configuration/Services.yaml @@ -11,15 +11,6 @@ services: # (e.g. because factories are to be used instead) exclude: '../Classes/{Frontend/Controller/TypoScriptFrontendController.php}' - TYPO3\CMS\Frontend\Middleware\ContentSecurityPolicyHeaders: - arguments: - $cache: '@cache.assets' - - TYPO3\CMS\Frontend\Middleware\PrepareTypoScriptFrontendRendering: - arguments: - $pageCache: '@cache.pages' - $typoScriptCache: '@cache.typoscript' - TYPO3\CMS\Frontend\Controller\ShowImageController: public: true @@ -55,11 +46,6 @@ services: TYPO3\CMS\Frontend\Html\HtmlWorker: public: true - TYPO3\CMS\Frontend\Cache\CacheLifetimeCalculator: - public: true - arguments: - $runtimeCache: '@cache.runtime' - # Register all available content objects TYPO3\CMS\Frontend\ContentObject\TextContentObject: tags: @@ -146,11 +132,6 @@ services: - name: frontend.contentobject identifier: 'SVG' - TYPO3\CMS\Frontend\Typolink\LinkFactory: - public: true - arguments: - $runtimeCache: '@cache.runtime' - TYPO3\CMS\Frontend\DataProcessing\CommaSeparatedValueProcessor: tags: - { name: 'data.processor', identifier: 'comma-separated-value' } diff --git a/typo3/sysext/recycler/Classes/Controller/RecyclerAjaxController.php b/typo3/sysext/recycler/Classes/Controller/RecyclerAjaxController.php index ab15707b0ee048406979a16c84112634146b1e66..6cdc6a4bfe905d49d1537d8a4ac90b7509d7d0f3 100644 --- a/typo3/sysext/recycler/Classes/Controller/RecyclerAjaxController.php +++ b/typo3/sysext/recycler/Classes/Controller/RecyclerAjaxController.php @@ -19,6 +19,7 @@ namespace TYPO3\CMS\Recycler\Controller; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use TYPO3\CMS\Backend\Attribute\AsController; use TYPO3\CMS\Backend\History\RecordHistory; use TYPO3\CMS\Backend\Utility\BackendUtility; @@ -52,6 +53,7 @@ class RecyclerAjaxController public function __construct( protected readonly BackendViewFactory $backendViewFactory, + #[Autowire(service: 'cache.runtime')] protected readonly FrontendInterface $runtimeCache, protected readonly IconFactory $iconFactory, protected readonly ConnectionPool $connectionPool, diff --git a/typo3/sysext/recycler/Configuration/Services.yaml b/typo3/sysext/recycler/Configuration/Services.yaml index 43e771638ed3e13f1767f9ff6d9023d37a7a5bd9..35286932a4c1ef7556fec91f8c2bada498025fcc 100644 --- a/typo3/sysext/recycler/Configuration/Services.yaml +++ b/typo3/sysext/recycler/Configuration/Services.yaml @@ -8,7 +8,3 @@ services: resource: '../Classes/*' # Tasks require EXT:scheduler to be installed, ignore for now. exclude: '../Classes/Task' - - TYPO3\CMS\Recycler\Controller\RecyclerAjaxController: - arguments: - $runtimeCache: '@cache.runtime' diff --git a/typo3/sysext/redirects/Classes/Service/RedirectService.php b/typo3/sysext/redirects/Classes/Service/RedirectService.php index bb431a4545af490cffcb412d44f45acb5b0f612b..d37d2ae3be7260f8ffd02472fb8cefd11401d176 100644 --- a/typo3/sysext/redirects/Classes/Service/RedirectService.php +++ b/typo3/sysext/redirects/Classes/Service/RedirectService.php @@ -21,6 +21,7 @@ use Psr\EventDispatcher\EventDispatcherInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\UriInterface; use Psr\Log\LoggerInterface; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use TYPO3\CMS\Core\Cache\Frontend\PhpFrontend; use TYPO3\CMS\Core\Context\Context; use TYPO3\CMS\Core\Exception\SiteNotFoundException; @@ -59,6 +60,7 @@ class RedirectService private readonly EventDispatcherInterface $eventDispatcher, private readonly PageInformationFactory $pageInformationFactory, private readonly FrontendTypoScriptFactory $frontendTypoScriptFactory, + #[Autowire(service: 'cache.typoscript')] private readonly PhpFrontend $typoScriptCache, private readonly LoggerInterface $logger, ) {} diff --git a/typo3/sysext/redirects/Configuration/Services.yaml b/typo3/sysext/redirects/Configuration/Services.yaml index ff62488ec202f671f8af55ccc9aed13bda73f858..0b021b02588be598db1cf45307624401bb910d1b 100644 --- a/typo3/sysext/redirects/Configuration/Services.yaml +++ b/typo3/sysext/redirects/Configuration/Services.yaml @@ -24,7 +24,3 @@ services: TYPO3\CMS\Redirects\Configuration\CheckIntegrityConfiguration: arguments: $extensionConfiguration: '@extension.configuration.redirects' - - TYPO3\CMS\Redirects\Service\RedirectService: - arguments: - $typoScriptCache: '@cache.typoscript' diff --git a/typo3/sysext/webhooks/Classes/Repository/WebhookRepository.php b/typo3/sysext/webhooks/Classes/Repository/WebhookRepository.php index 64cd6fae0be548f3888e80f11062ae1b92e91760..ec81f1fddf792e32dc7710dbd75386ab56771a4a 100644 --- a/typo3/sysext/webhooks/Classes/Repository/WebhookRepository.php +++ b/typo3/sysext/webhooks/Classes/Repository/WebhookRepository.php @@ -17,6 +17,7 @@ declare(strict_types=1); namespace TYPO3\CMS\Webhooks\Repository; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; use TYPO3\CMS\Core\Database\ConnectionPool; @@ -38,6 +39,7 @@ class WebhookRepository public function __construct( protected readonly ConnectionPool $connectionPool, + #[Autowire(service: 'cache.runtime')] protected readonly FrontendInterface $runtimeCache, ) {} diff --git a/typo3/sysext/webhooks/Configuration/Services.yaml b/typo3/sysext/webhooks/Configuration/Services.yaml index 63e24fdab59be4a812733adbc3c8529ad5d37d7c..a9258a1f5b8bd46cccb8f655156f9622fdb13271 100644 --- a/typo3/sysext/webhooks/Configuration/Services.yaml +++ b/typo3/sysext/webhooks/Configuration/Services.yaml @@ -17,10 +17,5 @@ services: TYPO3\CMS\Webhooks\Listener\MessageListener: public: true - TYPO3\CMS\Webhooks\Repository\WebhookRepository: - public: true # Required in test context - arguments: - $runtimeCache: '@cache.runtime' - TYPO3\CMS\Webhooks\Tca\ItemsProcFunc\WebhookTypesItemsProcFunc: public: true