ModifyLanguagePackRemoteBaseUrlEvent
The PSR-14 event
\TYPO3\
allows to modify the main URL of a language pack.
See also
Example
Registration of the event listener in the extension's Services.
:
services:
# Place here the default dependency injection configuration
MyVendor\MyExtension\EventListener\CustomMirror:
tags:
- name: event.listener
identifier: 'my-extension/custom-mirror'
Read how to configure dependency injection in extensions.
The corresponding event listener class:
<?php
declare(strict_types=1);
namespace MyVendor\MyExtension\EventListener;
use TYPO3\CMS\Core\Http\Uri;
use TYPO3\CMS\Install\Service\Event\ModifyLanguagePackRemoteBaseUrlEvent;
final 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));
}
}
}