mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 16:57:53 +00:00
[BUGFIX] Fixed middlewaresToLoad logic used before any routes loaded in RouterBase.
This commit is contained in:
@@ -111,13 +111,6 @@ class RouterBase {
|
|||||||
|
|
||||||
$originalUri = $this->request->getUri();
|
$originalUri = $this->request->getUri();
|
||||||
|
|
||||||
// Load group middlewares
|
|
||||||
|
|
||||||
/* @var $middleware RouterEntry */
|
|
||||||
foreach($this->middlewaresToLoad as $middleware) {
|
|
||||||
$middleware->loadMiddleware($this->request);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize boot-managers
|
// Initialize boot-managers
|
||||||
if(count($this->bootManagers)) {
|
if(count($this->bootManagers)) {
|
||||||
/* @var $manager RouterBootManager */
|
/* @var $manager RouterBootManager */
|
||||||
@@ -138,6 +131,12 @@ class RouterBase {
|
|||||||
// Loop through each route-request
|
// Loop through each route-request
|
||||||
$this->processRoutes($this->routes);
|
$this->processRoutes($this->routes);
|
||||||
|
|
||||||
|
// Load group middlewares
|
||||||
|
/* @var $route RouterEntry */
|
||||||
|
foreach($this->middlewaresToLoad as $route) {
|
||||||
|
$route->loadMiddleware($this->request);
|
||||||
|
}
|
||||||
|
|
||||||
$routeNotAllowed = false;
|
$routeNotAllowed = false;
|
||||||
|
|
||||||
// Make sure routes with longer urls are rendered first
|
// Make sure routes with longer urls are rendered first
|
||||||
@@ -309,7 +308,7 @@ class RouterBase {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function processUrl($route, $method = null, $parameters = null, $getParams = null) {
|
protected function processUrl(RouterRoute $route, $method = null, $parameters = null, $getParams = null) {
|
||||||
|
|
||||||
$domain = '';
|
$domain = '';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user