Mini optimization
This commit is contained in:
parent
028908053a
commit
f778c1f4a2
@ -12,9 +12,14 @@ abstract class Route {
|
|||||||
array_map(strtoupper(...), explode('|', $methods))
|
array_map(strtoupper(...), explode('|', $methods))
|
||||||
)) return;
|
)) return;
|
||||||
|
|
||||||
$request_path_parts = explode('/', urldecode(
|
static $cache;
|
||||||
|
if (!isset($cache)) {
|
||||||
|
$cache = explode('/', urldecode(
|
||||||
strtok($_SERVER['REQUEST_URI'], '?')
|
strtok($_SERVER['REQUEST_URI'], '?')
|
||||||
));
|
));
|
||||||
|
}
|
||||||
|
$request_path_parts = $cache;
|
||||||
|
|
||||||
$path_parts = explode('/', $path);
|
$path_parts = explode('/', $path);
|
||||||
$callback_args = [];
|
$callback_args = [];
|
||||||
for ($i=0; $i < count($path_parts); $i++) {
|
for ($i=0; $i < count($path_parts); $i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user