File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 11<?php
22namespace Gt \WebEngine ;
33
4+ use Gt \WebEngine \Debug \Timer ;
45use Gt \WebEngine \Redirection \Redirect ;
56
67class Application {
78 private Redirect $ redirect ;
9+ private Timer $ timer ;
810
911 public function __construct (
1012 ?Redirect $ redirect = null ,
@@ -13,6 +15,16 @@ public function __construct(
1315 }
1416
1517 public function start ():void {
18+ // Before we start, we check if the current URI should be redirected. If it
19+ // should, we won't go any further into the lifecycle.
1620 $ this ->redirect ->execute ();
21+ // The first thing done within the WebEngine lifecycle is start a timer.
22+ // This timer is only used again at the end of the call, when finish() is
23+ // called - at which point the entire duration of the request is logged out (and
24+ // slow requests are highlighted as a NOTICE).
25+ $ this ->timer = new Timer ();
26+
27+ // TODO: Test the timer! Then start some tests on Application (as much as possible in unit tests).
28+ // Then, when tests are passing, begin to reconstruct the Lifecycle in a much more testable way.
1729 }
1830}
You can’t perform that action at this time.
0 commit comments