Skip to content

Commit

Permalink
refs #10778 mark routes intialized in setRouteCollection
Browse files Browse the repository at this point in the history
  • Loading branch information
steinkel committed Mar 1, 2018
1 parent 243211b commit d3fbbbc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/Routing/Middleware/RoutingMiddleware.php
Expand Up @@ -14,7 +14,6 @@
*/
namespace Cake\Routing\Middleware;

=======
use Cake\Cache\Cache;
use Cake\Core\Configure;
use Cake\Core\PluginApplicationInterface;
Expand Down Expand Up @@ -74,10 +73,9 @@ protected function loadRoutes()
if (!$this->app) {
return;
}

$routeCollection = $this->buildRouteCollection();
Router::setRouteCollection($routeCollection);
// Prevent routes from being loaded again
Router::$initialized = true;
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/Routing/Router.php
Expand Up @@ -1157,6 +1157,7 @@ public static function getRouteCollection()
public static function setRouteCollection($routeCollection)
{
static::$_collection = $routeCollection;
Router::$initialized = true;
}

/**
Expand Down

0 comments on commit d3fbbbc

Please sign in to comment.