Errors and Diagnostics
The repository separates exception contracts from error presentation. ExceptionInterface (imspr/system/Exceptions/ExceptionInterface.php) declares no methods, while the framework’s presentation behavior is implemented separately by Exceptions (imspr/system/Debug/Exceptions.php). Detailed CLI and HTML rendering belongs to the related Error Presentation page. This page focuses on diagnostic extension points and the limits of treating source-defined tooling as active deployment behavior.
Toolbar extension and diagnostic handoff
The toolbar configuration (imspr/app/Config/Toolbar.php) declares database and route collectors in its $collectors array. The Views collector entry is commented out. The toolbar constructor iterates over configured collector class names, logs and skips an unavailable class, and instantiates an available one.
flowchart TD
prepare["Toolbar::prepare"] --> gate{"CI_DEBUG and not CLI?"}
gate -->|no| prep_skip["No toolbar preparation"]
gate -->|yes| download{"DownloadResponse?"}
download -->|yes| prep_skip
download -->|no| construct["After guards: read Config\\Toolbar::$collectors and construct configured collectors"]
construct --> run["Toolbar::run"]
run --> dataset["JSON diagnostic dataset"]
dataset --> artifact["Write timestamped JSON under WRITEPATH/debugbar/"]
artifact --> format{"AJAX or content type lacks html?"}
format -->|yes| headers["Set Debugbar-Time and Debugbar-Link headers"]
format -->|no| head{"Response body contains head?"}
head -->|yes| head_loader["Inject HTML debugbar loader in head"]
head -->|no| body_loader["Append HTML debugbar loader to body"]
respond["Toolbar::respond"] --> testing{"ENVIRONMENT is testing?"}
testing -->|yes| respond_skip["Return immediately"]
testing -->|no| query["Evaluate query parameters"]
query --> debugbar_q{"debugbar !== null?"}
debugbar_q -->|yes| loader["Return toolbarloader.js.php"]
loader --> loader_exit["Exit response"]
debugbar_q -->|no| time_q{"debugbar_time truthy?"}
time_q -->|yes| filename["Derive sanitized timestamp filename under WRITEPATH/debugbar/"]
time_q -->|no| no_query["No debugbar response branch"]
filename --> exists{"JSON file exists?"}
exists -->|yes| formatted["Read and format existing JSON"]
exists -->|no| missing["HTTP 404"]
The debugbar query takes precedence over debugbar_time: when both are supplied, the loader branch exits before timestamp retrieval. The source does not establish that the loader invokes the later request; treat that interaction as a separate conditional request.
[!WARNING] These are source-defined extension points, not proof that the toolbar is active in deployment. The reviewed sources do not establish a caller or registration for Toolbar::prepare or Toolbar::respond, and no successful runtime execution or retained debugbar artifact was observed.
Updated