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\ServiceAnnotation\Hook;

/**
 * @Hook("initializeSystem")
 */
class InitializeSystemListener
{
    public function __invoke(): void
    {
        // Do something …
    }
}

References