Skip to content

Internals Bootstrap Event Dispatcher

Stefan Crkvenjakov edited this page Oct 7, 2026 · 1 revision

bootstrap/event/dispatcher.php

Framework Internals · Subsystem overview · Developer guide

Source: bootstrap/event/dispatcher.php · Snapshot 8411f4287706.

Bootstrap scripts wire globals, constants and collaborators in a defined order. These files are executable entry points rather than a reusable class API.

Imports and dependencies

use event\EventDispatcher;
use router\events\EDynamicRouteListener;

Execution and global state

The script below is executed by its caller. Constants, registered callbacks, global assignments, guards, included files and their order are preserved here. Unlike class methods, entry-point execution can start the CLI loop, route a request, emit output, or terminate the process.

<?php
use event\EventDispatcher;
use router\events\EDynamicRouteListener;

global $routerManager;
global $eventDispatcher;

$dynamicRouteEvent = new EDynamicRouteListener();

$dynamicRouteEvent->addManager($routerManager);

$eventDispatcher->addListener("route.dynamic.add", $dynamicRouteEvent);

return $eventDispatcher;

Related types

Clone this wiki locally