ModifyLanguagePackRemoteBaseUrlEvent
Deprecated since version 14.2
The event
Modify
have been moved to
typo3/cms-core
. Therefore the namespace
changed from TYPO3CMSInstall
to
\TYPO3\.
There is a class alias that will be removed with TYPO3 v15.0.
See Deprecation: #109027 - Move language:update command and events to EXT:core.
The PSR-14 event
\TYPO3\
allows to modify the main URL of a language pack.
See also
Example
EXT:my_extension/Classes/EventListener/CustomMirror.php
<?php
declare(strict_types=1);
namespace MyVendor\MyExtension\EventListener;
use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Core\Http\Uri;
use TYPO3\CMS\Install\Service\Event\ModifyLanguagePackRemoteBaseUrlEvent;
#[AsEventListener(
identifier: 'my-extension/custom-mirror',
)]
final readonly class CustomMirror
{
private const EXTENSION_KEY = 'my_extension';
private const MIRROR_URL = 'https://example.org/typo3-packages/';
public function __invoke(ModifyLanguagePackRemoteBaseUrlEvent $event): void
{
if ($event->getPackageKey() === self::EXTENSION_KEY) {
$event->setBaseUrl(new Uri(self::MIRROR_URL));
}
}
}