We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd526db commit 07216c7Copy full SHA for 07216c7
src/WaterPipe/Routing/Router.php
@@ -49,6 +49,8 @@ class Router
49
*/
50
private $_request;
51
52
+ private $_built = false;
53
+
54
private function __construct()
55
{
56
$this->_request =& Request::getInstance();
@@ -65,8 +67,12 @@ public static function &getInstance()
65
67
66
68
public function build()
69
- $this->_detectUri();
- $this->_detectMethod();
70
+ if (!$this->_built) {
71
+ $this->_detectUri();
72
+ $this->_detectMethod();
73
74
+ $this->_built = true;
75
+ }
76
77
return $this;
78
}
@@ -142,6 +148,14 @@ private function _detectMethod()
142
148
143
149
144
150
151
+ /**
152
+ * @return bool
153
+ */
154
+ public function isBuilt(): bool
155
+ {
156
+ return $this->_built;
157
158
145
159
/**
146
160
* @return Request
147
161
0 commit comments