Module
API reference › Debug › Module
Bootstraps the debug toolbar and the full-page debugger over the active application.
Attaches a LogTarget to capture per-request data, registers URL rules for the debugger routes, wires the
toolbar/exception-page injection listeners, and registers the collectors and panels declared in $collectors
and $panels (merged on top of the built-in core definitions).
Registration itself is delegated to the services under yii\debug\service, which the module resolves through its
own service locator. An application replaces one by registering a definition under the service class name: a class
name, a configuration array carrying class, a callable, or a ready-made instance. Every definition but an
instance is built with this module bound to the module argument, so a replacement declaring Module $module
receives it.
The definition must be in place before the module resolves the service. CapturePolicyFactory,
CollectorRegistrar, PanelRegistrar, and StandaloneActionResolver are resolved during
init() and LogTargetFactory during bootstrap(), so replacing those requires the module
components configuration; the remaining services may also be replaced later through
ServiceLocator::set().
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$actionMap | array<string, | Mapping from action IDs to standalone Action class configurations. Default: []. Available since 22.0. | yii\ |
$actionNamespace | string| | The namespace where standalone Action subclasses are located for convention-based discovery, parallel to $controllerNamespace for controllers. Default: null. Available since 22.0. | yii\ |
$aliases write-only | array | List of path aliases to be defined. | yii\ |
$allowedHosts | list<string> | Hosts allowed to access this module. Each entry is resolved to an IP at runtime; useful for dynamic DNS. Default: []. | Module |
$allowedIPs | list<string> | IPs allowed to access this module. Entries may be exact, wildcard (192.168.0.*) or CIDR (172.16.0.0/12). Default: ['127.0.0.1',. | Module |
$authManager | array<string,yii\| | RBAC access checker component id or fully configured manager. Default: 'authManager'. | Module |
$basePath | string | The root directory of the module. | yii\ |
$behaviors read-only | array<yii\<static>> | List of behaviors attached to this component. | yii\ |
$checkAccessCallback | callable(yii\| | Callback evaluated by checkAccess(). Receives the current Action (or null) and must return true to grant access. Default: null. | Module |
$collectorCoordinator read-only | PHPForge\ | Configured collector coordinator. | Module |
$collectors | array<array-key,Closure(CapturePolicy): CollectorInterface|CollectorInterface| | Debug collectors resolved from instances, class names, Yii configuration arrays, or Closure factories during init(). Default: []. | Module |
$components | array | The list of the component definitions or the loaded component instances (ID => definition or instance). | yii\ |
$controllerMap | array | Mapping from controller ID to controller configurations. Default: []. | yii\ |
$controllerNamespace | string| | The namespace that controller classes are in. Default: null. | yii\ |
$controllerPath | string | The directory that contains the controller classes. | yii\ |
$dataPath | string | Directory storing the debugger data files (path alias accepted). Default: '@runtime/debug'. | Module |
$debugHeaders write-only | yii\ | Response event raised after the action ran. | Module |
$defaultHeight | int | Debug bar default height, as a percentage of the total screen height. Default: 50. | Module |
$defaultPanel | string | Name of the panel that should be visible when opening the debug panel. Default: 'log'. | Module |
$defaultRoute | Route dispatched when the module is requested without an action segment. Default: 'index'. | Module | |
$dirMode | int | Permission applied to newly created debugger directories (used by chmod()); no umask is applied. Default: 0700. | Module |
$disableCallbackRestrictionWarning | bool | Whether to disable the access-callback restriction warning emitted by checkAccess(). Default: false. | Module |
$disableIpRestrictionWarning | bool | Whether to disable the IP restriction warning emitted by checkAccess(). Default: false. | Module |
$dispatchers | array<string, | Collector IDs to hand to application components as their PSR-14 dispatcher, collectorId => componentId. Default: []. | Module |
$enableDebugLogs | bool | Whether to keep log messages emitted by debug-module requests. Enable only when debugging the module itself. Default: false. | Module |
$fileMode | int| | Permission applied to newly created debugger data files (used by chmod()). Default: 0600. | Module |
$historySize | int | Maximum number of debug data files to keep; older snapshots beyond this count are pruned. Default: 50. | Module |
$id | string | An ID that uniquely identifies this module among other modules which have the same parent. Default: null. | yii\ |
$layout | string| | The layout that should be applied for views within this module. Default: null. | yii\ |
$layoutPath | string | The root directory of layout files. | yii\ |
$logTarget | array<string,LogTarget| | LogTarget instance, configuration array, or class name. Always coerced to a LogTarget by bootstrap(). Default: 'yii\. | Module |
$maxBodyBytes | int | Maximum raw request or response body bytes retained by the shared capture policy. Default: \. | Module |
$module | yii\| | The parent module of this module. null if this module does not have a parent. Default: null. | yii\ |
$modules | array | The modules (indexed by their IDs). | yii\ |
$pageTitle | callable(string): string| | Page title literal string or a callable receiving the base URL and returning a string. Default: null. | Module |
$panelRegistry read-only | PanelRegistry | Resolved panel catalog. | Module |
$panels | array<string, Panel> | Debug panels indexed by panel id. May be populated with config arrays / class names before initPanels() runs, but after initialization the array holds only Panel instances. Default: []. | Module |
$params | array | Custom module parameters (name => value). Default: []. | yii\ |
$sensitiveKeyPatterns | list<string>| | PCRE patterns applied to complete data keys. null enables Debug Core defaults when the default exact-key list is active; [] explicitly disables pattern matching. Default: null. | Module |
$sensitiveKeyPrefixes | list<string> | Literal, case-insensitive data-key prefixes redacted from every persistent debugger capture. Default: []. | Module |
$sensitiveKeys | list<string> | Exact, case-insensitive data keys redacted from every persistent debugger capture. Default: \. | Module |
$shellContextFactory read-only | yii\ | Resolved shell factory. | Module |
$skipAjaxRequestUrl | array<int| | Routes whose AJAX hits should NOT appear in the toolbar history (e.g. polling endpoints). Default: []. | Module |
$toolbarHtml read-only | string | Rendered <yii-debug-toolbar> element. | Module |
$toolbarPosition | string | Toolbar position on the page ('bottom' or 'upper'). Default: 'bottom'. | Module |
$traceLine | callable(array<string, Panel): string| | Trace-line template placeholder string ({file}, {line}, {text}), callable returning the rendered line, or false to disable trace-line rendering entirely. Default: self::DEFAULT_IDE_TRACELINE. | Module |
$tracePathMappings | array<string, | Maps containerized/remote paths to local paths for the {file} portion of $traceLine; only the first match is applied. Default: []. | Module |
$uniqueId read-only | string | The unique ID of the module. | yii\ |
$urlRuleClass | string | Class name of the UrlRule used for rules generated by this module. Default: 'yii\. | Module |
$version | string| | The version of this module. | yii\ |
$viewPath | string | Path containing the framework-neutral Debug Core templates. Default: '@vendor/php-forge/debug-core/resources/views'. | Module |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Constructor. | yii\ |
__call() | Calls the named method which is not a class method. | yii\ |
__clone() | This method is called after the object is created by cloning an existing one. | yii\ |
__get() | Getter magic method. | yii\ |
__isset() | Checks if a property value is null. | yii\ |
__set() | Sets the value of a component property. | yii\ |
__unset() | Sets a component property to be null. | yii\ |
afterAction() | This method is invoked right after an action within this module is executed. | yii\ |
attachBehavior() | Attaches a behavior to this component. | yii\ |
attachBehaviors() | Attaches a list of behaviors to the component. | yii\ |
beforeAction() | Disables the application log targets when $enableDebugLogs is false, applies the access check, and detaches the toolbar/header listeners so the debugger response is not polluted with self-debug data. | Module |
behaviors() | Returns a list of behaviors that this component should behave as. | yii\ |
bootstrap() | Wires the debug log target, the toolbar/header listeners, the error-page injection hook, and the debugger URL rules onto the application. | Module |
canGetProperty() | Returns a value indicating whether a property can be read. | yii\ |
canSetProperty() | Returns a value indicating whether a property can be set. | yii\ |
className() static | Returns the fully qualified name of this class. | yii\ |
clear() | Removes the component from the locator. | yii\ |
createCapturePolicy() | Creates the shared persistent-data policy, optionally extending its exact-key list for one collector. | Module |
createController() | Creates a controller instance based on the given route. | yii\ |
createControllerByID() | Creates a controller based on the given controller ID. | yii\ |
detachBehavior() | Detaches a behavior from the component. | yii\ |
detachBehaviors() | Detaches all behaviors from the component. | yii\ |
ensureBehaviors() | Makes sure that the behaviors declared in behaviors() are attached to this component. | yii\ |
get() | Returns the component instance with the specified ID. | yii\ |
getBasePath() | Returns the root directory of the module. | yii\ |
getBehavior() | Returns the named behavior object. | yii\ |
getBehaviors() | Returns all behaviors attached to this component. | yii\ |
getCollectorCoordinator() | Returns the validated collector coordinator used by the request log target. | Module |
getComponents() | Returns the list of the component definitions or the loaded component instances. | yii\ |
getControllerPath() | Returns the directory that contains the controller classes according to $controllerNamespace. | yii\ |
getInstance() static | Returns the currently requested instance of this module class. | yii\ |
getLayoutPath() | Returns the directory that contains layout view files for this module. | yii\ |
getLogTarget() | Returns the initialized LogTarget, raising when the module has not been bootstrapped. | Module |
getModule() | Retrieves the child module of the specified ID. | yii\ |
getModules() | Returns the sub-modules in this module. | yii\ |
getPanelRegistry() | Returns the effective panel catalog, which carries the display order and the IDs disabled by configuration. | Module |
getShellContextFactory() | Returns the factory building the page shell of every debugger action. | Module |
getToolbarHtml() | Returns the toolbar HTML: a <yii-debug-toolbar> custom element wired with data attributes the bundled JS reads. | Module |
getUniqueId() | Returns an ID that uniquely identifies this module among all modules within the current application. | yii\ |
getVersion() | Returns current module version. | yii\ |
getViewPath() | Returns the directory that contains the view files for this module. | yii\ |
getYiiLogo() static | Returns the Yii logo as a data URI ready to drop into <img src="…"> or <link rel="icon">. | Module |
has() | Returns a value indicating whether the locator has the specified component definition or has instantiated the component. | yii\ |
hasEventHandlers() | Returns a value indicating whether there is any handler attached to the named event. | yii\ |
hasMethod() | Returns a value indicating whether a method is defined. | yii\ |
hasModule() | Checks whether the child module of the specified ID exists. | yii\ |
hasProperty() | Returns a value indicating whether a property is defined for this component. | yii\ |
htmlTitle() | Resolves the page title used in the debugger HTML: the literal $pageTitle string when set, the result of the configured callable, or the default Yii Debugger label. | Module |
init() | Resolves the $dataPath alias and instantiates every configured panel. | Module |
injectToolbarOnErrorPage() | Injects the debug toolbar into the rendered HTML of an error page (yiisoft/yii2#7616). | Module |
off() | Detaches an existing event handler from this component. | yii\ |
on() | Attaches an event handler to an event. | yii\ |
renderToolbar() | Renders the mini-toolbar at the end of the page body. | Module |
route() static | Builds a module-absolute route array for the given debugger action. | Module |
runAction() | Runs a controller action specified by a route. | yii\ |
set() | Registers a component definition with this locator. | yii\ |
setAliases() | Defines path aliases. | yii\ |
setBasePath() | Sets the root directory of the module. | yii\ |
setComponents() | Registers a set of component definitions in this locator. | yii\ |
setControllerPath() | Sets the directory that contains the controller classes. | yii\ |
setDebugHeaders() | Sets headers carrying debug data on AJAX responses so the toolbar can resolve the captured tag and link back to the full view. | Module |
setInstance() static | Sets the currently requested instance of this module class. | yii\ |
setLayoutPath() | Sets the directory that contains the layout files. | yii\ |
setModule() | Adds a sub-module to this module. | yii\ |
setModules() | Registers sub-modules in the current module. | yii\ |
setVersion() | Sets current module version. | yii\ |
setViewPath() | Sets the directory that contains the view files. | yii\ |
setYiiLogo() static | Sets the logo data URI returned by getYiiLogo(). | Module |
trigger() | Triggers an event. | yii\ |
checkAccess() protected | Returns whether the current request is allowed to access the debugger. | Module |
coreActionMap() protected | Built-in standalone actions dispatched through Module::$actionMap, keyed by action ID. | Module |
coreCollectors() protected | Built-in collectors paired by stable ID with their presentation panels. | Module |
corePanels() protected | Returns the built-in panel configurations, ordered as the request itself unfolds. | Module |
createStandaloneAction() protected | Resolves a debugger endpoint from Module::$actionMap before falling back to convention-based discovery. | Module |
defaultVersion() protected | Returns the default module version string. | Module |
initActionMap() protected | Hands the built-in, panel-declared, and configured standalone actions to StandaloneActionResolver and stores the merged map on Module::$actionMap. | Module |
initCollectors() protected | Hands the built-in and configured collector definitions to CollectorRegistrar and stores the resolved collectors with the coordinator driving them. | Module |
initPanels() protected | Hands the built-in and configured panel definitions to PanelRegistrar and stores the resolved panels with the catalog describing their display order. | Module |
initPanelServices() protected | Registers every enabled panel in the module service locator under its own class and each ancestor class below Panel. | Module |
resetGlobalSettings() protected | Resets application-wide settings the debugger should not inherit from the host application (currently the asset bundles registry). | Module |
runMappedAction() protected | Runs a standalone action registered in $actionMap. | yii\ |
runStandaloneAction() protected | Runs a standalone Action instance through the standard module/action event lifecycle. | yii\ |
setDebuggerResponseHeaders() protected | Applies the debugger response hardening policy. | Module |
Events
Section titled “Events”| Event | Type | Description | Defined by |
|---|---|---|---|
EVENT_BEFORE_ACTION | yii\ | An event raised before executing a controller action. Event name: 'beforeAction'. | yii\ |
EVENT_AFTER_ACTION | yii\ | An event raised after executing a controller action. Event name: 'afterAction'. | yii\ |
Constants
Section titled “Constants”| Constant | Value | Description | Defined by |
|---|---|---|---|
DEFAULT_IDE_TRACELINE | \ | Default $traceLine template: the shared ide:// deep link that IDE extensions resolve into “open file at line”. | Module |
SOURCE_PATH | '@vendor/php-forge/debug-core/resources/assets' | Default source path for the framework-neutral Debug Core assets. The framework adapter may override this to provide a different path. | Module |
VIEW_PATH_ALIAS | '@yiiDebugViews' | Adapter-owned alias for the shared Debug Core templates. | Module |
Property details
Section titled “Property details”$collectors
Section titled “$collectors ”public array<array-key, array<string, mixed>|Closure(PHPForge\Debug\Capture\CapturePolicy): PHPForge\Debug\CollectorInterface|PHPForge\Debug\CollectorInterface|string> $collectors = []Debug collectors resolved from instances, class names, Yii configuration arrays, or Closure factories during
init().
Collectors derive their own IDs; register them as a list or under a key that matches CollectorInterface::id(). A Closure receives the module CapturePolicy, so a collector capturing user
data redacts it with the rules the Request panel applies.
After initialization, this property holds a list of resolved instances in registration order.
$dispatchers
Section titled “$dispatchers ”public array<string, string> $dispatchers = []Collector IDs to hand to application components as their PSR-14 dispatcher, collectorId => componentId.
The component takes the collector on a public eventDispatcher property or on a constructor parameter named
eventDispatcher; an already instantiated component only accepts the property form. A dispatcher the component
already configures is kept, and a collector disabled through enabled => false is skipped.
Method details
Section titled “Method details”beforeAction()
Section titled “beforeAction() ”public function beforeAction(yii\base\Action $action): boolDisables the application log targets when $enableDebugLogs is false, applies the access check, and
detaches the toolbar/header listeners so the debugger response is not polluted with self-debug data.
Parameters
| Parameter | Type | Description |
|---|---|---|
$action | yii\ | Action about to run. |
Returns
bool: true when the action may run; false to stop the dispatch.
Throws
yii\base\InvalidConfigException: when the log component cannot be resolved.yii\web\ForbiddenHttpException: when an identity action has no user-switch authorization behavior or the caller fails the access check on a non-toolbar route.Throwable: when an active collector cannot shut down cleanly.
bootstrap()
Section titled “bootstrap() ”public function bootstrap(yii\base\Application $app): voidWires the debug log target, the toolbar/header listeners, the error-page injection hook, and the debugger URL rules onto the application.
Called by Yii during the application bootstrap phase (when this module is listed in bootstrap).
Parameters
| Parameter | Type | Description |
|---|---|---|
$app | yii\ | Application being bootstrapped. |
Throws
yii\base\InvalidConfigException: when the log-target configuration does not resolve to aLogTarget.
createCapturePolicy()
Section titled “createCapturePolicy() ”public function createCapturePolicy(list<string> $additionalSensitiveKeys = []): PHPForge\Debug\Capture\CapturePolicyCreates the shared persistent-data policy, optionally extending its exact-key list for one collector.
Parameters
| Parameter | Type | Description |
|---|---|---|
$additionalSensitiveKeys | list<string> | Collector-specific exact keys added without weakening global rules. |
Returns
CapturePolicy: Shared policy covering the global rules and the collector-specific keys.
Throws
InvalidArgumentException: when the configured keys, prefixes, patterns, or body limit are rejected.yii\base\InvalidConfigException: when the registeredCapturePolicyFactorydefinition is invalid.
getCollectorCoordinator()
Section titled “getCollectorCoordinator() ”public function getCollectorCoordinator(): PHPForge\Debug\Collector\CollectorCoordinatorReturns the validated collector coordinator used by the request log target.
Returns
PHPForge\Debug\Collector\CollectorCoordinator: Configured collector coordinator.
Throws
yii\base\InvalidConfigException: when module initialization has not completed.
getLogTarget()
Section titled “getLogTarget() ”public function getLogTarget(): yii\debug\LogTargetReturns the initialized LogTarget, raising when the module has not been bootstrapped.
Returns
LogTarget: Initialized log target of this module.
Throws
yii\base\InvalidConfigException: whenbootstrap()has not run yet, so$logTargetis still a configuration array or a class name.
getPanelRegistry()
Section titled “getPanelRegistry() ”public function getPanelRegistry(): PHPForge\Debug\Registration\PanelRegistryReturns the effective panel catalog, which carries the display order and the IDs disabled by configuration.
Returns
PanelRegistry: Resolved panel catalog.
Throws
yii\base\InvalidConfigException: when module initialization has not completed.
getShellContextFactory()
Section titled “getShellContextFactory() ”public function getShellContextFactory(): yii\debug\service\ShellContextFactoryReturns the factory building the page shell of every debugger action.
Registering ShellContextFactory under components replaces it, like any other module service.
Returns
yii\debug\service\ShellContextFactory: Resolved shell factory.
Throws
yii\base\InvalidConfigException: when the registeredShellContextFactorydefinition is invalid.
getToolbarHtml()
Section titled “getToolbarHtml() ”public function getToolbarHtml(): stringReturns the toolbar HTML: a <yii-debug-toolbar> custom element wired with data attributes the bundled JS
reads.
Returns
string: Rendered <yii-debug-toolbar> element.
Throws
yii\base\InvalidConfigException: whenbootstrap()has not run yet.
getYiiLogo()
Section titled “getYiiLogo() ”public static function getYiiLogo(): stringReturns the Yii logo as a data URI ready to drop into <img src="…"> or <link rel="icon">.
Uses the shared frontend file so every framework adapter renders the same Yii mark.
Returns
string: Logo as a data URI.
htmlTitle()
Section titled “htmlTitle() ”public function htmlTitle(): stringResolves the page title used in the debugger HTML: the literal $pageTitle string when set, the result of
the configured callable, or the default Yii Debugger label.
Returns
string: Page title for the debugger HTML.
init()
Section titled “init() ”public function init(): voidResolves the $dataPath alias and instantiates every configured panel.
Throws
yii\base\InvalidConfigException: when a panel configuration cannot be resolved into aPanelinstance.
injectToolbarOnErrorPage()
Section titled “injectToolbarOnErrorPage() ”public function injectToolbarOnErrorPage(yii\web\ErrorHandlerRenderEvent $event): voidInjects the debug toolbar into the rendered HTML of an error page (yiisoft/yii2#7616).
Wired in bootstrap() as a listener for ErrorHandler::EVENT_AFTER_RENDER; the event fires after
renderException() produces the HTML body but before the response is sent, so handlers may rewrite the output.
Parameters
| Parameter | Type | Description |
|---|---|---|
$event | yii\ | Render event carrying the error-page HTML. |
Throws
yii\base\InvalidConfigException: whenbootstrap()has not run yet.
renderToolbar()
Section titled “renderToolbar() ”public function renderToolbar(yii\base\Event $event): voidRenders the mini-toolbar at the end of the page body.
Wired in bootstrap() as a listener for View::EVENT_END_BODY. The toolbar template is rendered
dynamically while its runtime URL is resolved through the Yii2 asset manager.
Parameters
| Parameter | Type | Description |
|---|---|---|
$event | yii\ | End-of-body event raised by the view. |
Throws
yii\base\InvalidConfigException: whenbootstrap()has not run yet.Throwable: when the view dynamic render fails for the current request.
route()
Section titled “route() ”public static function route(string $action, array<string, yii\debug\TValue> $params = []): non-empty-array<int|string, string|yii\debug\TValue>Builds a module-absolute route array for the given debugger action.
Resolves the module ID from the standalone action currently being dispatched, so widgets and views can build
links without a controller context; outside a debugger dispatch the conventional debug module ID is used.
Parameters
| Parameter | Type | Description |
|---|---|---|
$action | string | Debugger action ID. |
$params | array<string, | Query parameters merged into the route array. |
Returns
non-empty-array<int|string, string|yii\debug\TValue>: Route array ready for Url::to().
setDebugHeaders()
Section titled “setDebugHeaders() ”public function setDebugHeaders(yii\base\Event $event): voidSets headers carrying debug data on AJAX responses so the toolbar can resolve the captured tag and link back to the full view.
Parameters
| Parameter | Type | Description |
|---|---|---|
$event | yii\ | Response event raised after the action ran. |
Throws
yii\base\InvalidConfigException: whenbootstrap()has not run yet.
setYiiLogo()
Section titled “setYiiLogo() ”public static function setYiiLogo(string $logo): voidSets the logo data URI returned by getYiiLogo().
Parameters
| Parameter | Type | Description |
|---|---|---|
$logo | string | Logo as a data URI. |
checkAccess()
Section titled “checkAccess() ”protected function checkAccess(yii\base\Action|null $action = null): boolReturns whether the current request is allowed to access the debugger.
Decided by AccessGuard from $allowedIPs, $allowedHosts, and the optional
$checkAccessCallback, for the IP the current request carries.
Parameters
| Parameter | Type | Description |
|---|---|---|
$action | yii\| | Action being dispatched, or null outside an action context. |
Returns
bool: true when the request may reach the debugger; false otherwise.
Throws
yii\base\InvalidConfigException: when the registeredAccessGuarddefinition is invalid.
coreActionMap()
Section titled “coreActionMap() ”protected function coreActionMap(): array<string, class-string>Built-in standalone actions dispatched through Module::$actionMap, keyed by action ID.
Returns
array<string, class-string>: Action classes indexed by action id.
coreCollectors()
Section titled “coreCollectors() ”protected function coreCollectors(): array<string, array<string, mixed>|string>Built-in collectors paired by stable ID with their presentation panels.
Array keys are a configuration-merge convenience and must match each collector’s CollectorInterface::id()
so a user entry under the same key replaces the built-in collector.
Returns
array<string, array<string, mixed>|string>: Collector definitions indexed by collector id.
corePanels()
Section titled “corePanels() ”protected function corePanels(): array<string, array<string, mixed>|class-string<yii\debug\Panel>|class-string<PHPForge\Debug\Panel>|string>Returns the built-in panel configurations, ordered as the request itself unfolds.
The primary navigation lists Request, Logs, Events, Profiling, Database, Mail, Queue, User, Dump, and Asset
Bundles. config opens the list but is surfaced through the brand bar rather than the panel nav; router only
feeds Request.
CoreDefinitions::merge() drops a built-in whose optional package is not installed (queue without
yii\queue\Queue).
Returns
array<string, array<string, mixed>|class-string<Panel>|class-string<PHPForge\Debug\Panel>|string>: Panel definitions indexed by panel id.
createStandaloneAction()
Section titled “createStandaloneAction() ”protected function createStandaloneAction(string $route): yii\base\Action|nullResolves a debugger endpoint from Module::$actionMap before falling back to convention-based
discovery.
Application-level dispatch of a module-prefixed route (for example debug/db-explain) reaches this method
through Module::createStandaloneAction(). Convention discovery derives a root-namespace class
from the action ID (db-explain becomes DbExplainAction) and cannot see the sub-namespaced panel action
classes (ExplainAction, JobAction), so the mapped
entries are consulted first to keep those routes reachable.
Parameters
| Parameter | Type | Description |
|---|---|---|
$route | string | Action route relative to this module. |
Returns
yii\base\Action|null: Resolved action, or null when the route matches none.
Throws
yii\base\InvalidConfigException: when object creation fails for a resolvable action-map entry.
defaultVersion()
Section titled “defaultVersion() ”protected function defaultVersion(): stringReturns the default module version string.
Returns
string: Version label reported for this module.
initActionMap()
Section titled “initActionMap() ”protected function initActionMap(): voidHands the built-in, panel-declared, and configured standalone actions to StandaloneActionResolver and
stores the merged map on Module::$actionMap.
Throws
yii\base\InvalidConfigException: when the registered resolver definition is invalid.
initCollectors()
Section titled “initCollectors() ”protected function initCollectors(): voidHands the built-in and configured collector definitions to CollectorRegistrar and stores the resolved
collectors with the coordinator driving them.
Each resolved collector is instrumented right away: initPanels() runs afterwards and a panel constructor
may already hit the framework, so instrumentation installed only at Application::EVENT_BEFORE_REQUEST
would miss the debugger’s own bootstrap work.
Throws
yii\base\InvalidConfigException: When a collector configuration or ID is invalid.
initPanels()
Section titled “initPanels() ”protected function initPanels(): voidHands the built-in and configured panel definitions to PanelRegistrar and stores the resolved panels
with the catalog describing their display order.
Throws
yii\base\InvalidConfigException: when a panel configuration, a registration option, or the resolved catalog is invalid.
initPanelServices()
Section titled “initPanelServices() ”protected function initPanelServices(): voidRegisters every enabled panel in the module service locator under its own class and each ancestor class below
Panel.
Standalone actions receive the registered instance through a typed run() parameter resolved by the
standalone-action binder, so a configured panel subclass satisfies a built-in type hint such as
DbPanel $panel. The generic Panel base class is never registered because multiple panels would compete
for it; when panels share a class chain, the later entry in $panels order wins, matching the action ID
precedence in initActionMap().
resetGlobalSettings()
Section titled “resetGlobalSettings() ”protected function resetGlobalSettings(): voidResets application-wide settings the debugger should not inherit from the host application (currently the asset bundles registry).
setDebuggerResponseHeaders()
Section titled “setDebuggerResponseHeaders() ”protected function setDebuggerResponseHeaders(yii\web\Response $response): voidApplies the debugger response hardening policy.
Kept as an extension point so applications can customize the policy without replacing the complete
beforeAction() lifecycle.
Parameters
| Parameter | Type | Description |
|---|---|---|
$response | yii\ | Response about to be sent. |