initializeSystem

The initializeSystem hook is triggered right after the system initialization process is finished and before the request processing is started. This also means the request has no contao request scope set and no language redirects have been executed.

Example

// src/EventListener/InitializeSystemListener.php
namespace App\EventListener;

use Contao\CoreBundle\DependencyInjection\Attribute\AsHook;

#[AsHook('initializeSystem')]
class InitializeSystemListener
{
    public function __invoke(): void
    {
        // Do something …
    }
}

References