Compare commits

...

5 Commits

Author SHA1 Message Date
Simon Sessingø 969b64650e Merge pull request #18 from skipperbent/development
[OPTIMISATION] Optimised router handling - router will now use the or…
2015-10-27 14:02:57 +01:00
Simon Sessingø c2cf2334e7 [OPTIMISATION] Optimised router handling - router will now use the order provided when loading routes. 2015-10-27 14:01:19 +01:00
Simon Sessingø af730e6e15 Merge pull request #17 from skipperbent/development
Development
2015-10-27 11:06:36 +01:00
Simon Sessingø f5a32cf520 [BUGFIX] Fixed router paths. 2015-10-27 10:35:57 +01:00
Simon Sessingø 1843ea0594 [BUGFIX] Fixed routes always matching /show/{id} when other routes are added. 2015-10-27 10:29:40 +01:00
2 changed files with 2 additions and 7 deletions
-5
View File
@@ -100,11 +100,6 @@ class RouterBase {
// Loop through each route-request
$this->processRoutes($this->routes);
// Make sure the urls is in the right order when comparing
usort($this->controllerUrlMap, function($a, $b) {
return strcmp($b->getUrl(), $a->getUrl());
});
$routeNotAllowed = false;
/* @var $route RouterEntry */
+2 -2
View File
@@ -49,7 +49,7 @@ class RouterRoute extends RouterEntry {
// Check if url parameter count matches
if(stripos($url, $routeMatch) === 0) {
$matches = true;
$matches = (count(explode('/', rtrim($url, '/'))) == count(explode('/', rtrim($route, '/'))));
if($this->regexMatch) {
$parameters = $this->parseParameters($url, true, $this->regexMatch);
@@ -62,7 +62,7 @@ class RouterRoute extends RouterEntry {
} else {
$url = explode('/', $url);
$route = explode('/', $route);
$route = explode('/', rtrim($route, '/'));
$parameters = array();