Deprecation: #109027 - Move language:update command and events to EXT:core
See forge#109027
Description
The language: CLI command and related
\TYPO3\ have been moved from
EXT: to EXT:, allowing installations to update language packs
without EXT: having to be installed.
Since TYPO3 v13 it has been possible to run TYPO3 without EXT: in
Composer-based installations. However, the language: command still
required EXT:, which was impractical for deployments that needed to
update language packs.
The following classes have been moved, and their old class names deprecated:
\TYPO3\is nowCMS\ Install\ Command\ Language Pack Command \TYPO3\CMS\ Core\ Command\ Update Language Pack Command \TYPO3\is nowCMS\ Install\ Service\ Event\ Modify Language Pack Remote Base Url Event \TYPO3\CMS\ Core\ Localization\ Event\ Modify Language Pack Remote Base Url Event \TYPO3\is nowCMS\ Install\ Service\ Event\ Modify Language Packs Event \TYPO3\CMS\ Core\ Localization\ Event\ Modify Language Packs Event
The old class names are registered as aliases via
\Class and
continue to work in TYPO3 v14. Event listeners registered for the deprecated
event class names are still called when the new event is dispatched, with a
deprecation notice triggered at runtime.
Impact
Using the old class names will trigger a deprecation notice. The extension scanner will report usage of the deprecated class names.
The old class names will be removed in TYPO3 v15.
Affected installations
Extensions that use one or more of the deprecated class names listed above.
Migration
Replace the old class names with the new ones in
use statements:
<?php
declare(strict_types=1);
namespace MyVendor\MyExtension\EventListener;
use TYPO3\CMS\Core\Attribute\AsEventListener;
-use TYPO3\CMS\Install\Service\Event\ModifyLanguagePacksEvent;
+use TYPO3\CMS\Core\Localization\Event\ModifyLanguagePacksEvent;
final class MyEventListener
{
#[AsEventListener(
identifier: 'my-extension/modify-language-packs',
)]
public function __invoke(
ModifyLanguagePacksEvent $event,
): void {
// ...
}
}
<?php
declare(strict_types=1);
namespace MyVendor\MyExtension\EventListener;
use TYPO3\CMS\Core\Attribute\AsEventListener;
-use TYPO3\CMS\Install\Service\Event\ModifyLanguagePackRemoteBaseUrlEvent;
+use TYPO3\CMS\Core\Localization\Event\ModifyLanguagePackRemoteBaseUrlEvent;
final class MyOtherEventListener
{
#[AsEventListener(
identifier: 'my-extension/modify-language-pack-remote-base-url',
)]
public function __invoke(
ModifyLanguagePackRemoteBaseUrlEvent $event,
): void {
// ...
}
}
Note
Extensions supporting both TYPO3 v13 and v14 do not need to change
anything. The old class names continue to work in both versions.
Simply update the
use statements when dropping TYPO3 v13 support.