PluginProbe
404 Solution / trunk
404 Solution vtrunk
4.3.5 4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.2.0 4.1.19 4.1.18 4.1.17 4.1.16 4.1.15 4.1.13 4.1.12 4.1.11 4.1.10 4.1.9 4.1.8 4.1.7 4.1.6 4.1.5 4.1.4 4.1.3 trunk 2.30.0 All 109 releases
404-solution / includes / frontend / FrontendPipelineTrace.php

FrontendPipelineTrace.php in 404 Solution trunk, at includes/frontend/FrontendPipelineTrace.php

33 lines 952 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if (!defined('ABSPATH')) {
4 exit;
5 }
6
7 /**
8 * Ordered record of (step, outcome, detail) tuples produced by one frontend
9 * request pipeline execution. The trace is attached to redirect-hit log rows
10 * and used by the debug interstitial to explain why a request 404'd or matched.
11 *
12 * Mutable; created per request. Helpers receive the same instance and append
13 * to it as they make decisions.
14 */
15 class ABJ_404_Solution_FrontendPipelineTrace {
16
17 /** @var list<array{step: string, outcome: string, detail: string}> */
18 private $steps = array();
19
20 function add(string $step, string $outcome, string $detail = ''): void {
21 $this->steps[] = array('step' => $step, 'outcome' => $outcome, 'detail' => $detail);
22 }
23
24 /** @return list<array{step: string, outcome: string, detail: string}> */
25 function getSteps(): array {
26 return $this->steps;
27 }
28
29 function reset(): void {
30 $this->steps = array();
31 }
32 }
33