src/Router.php
public function resolve(string $request)
    {
        $parts = array_filter(explode("/", $request));

        // Determine the file extension
        $last_part = end($parts);
        $dpos = strrpos($last_part, '.');
        if (!empty($dpos)) // If a dot exists after the first character
            $ext = substr($last_part, $dpos);
        else
            $ext = "";

        $root = $this->getRoutes();

        $route = $root->resolve($parts, $ext);

        if (!empty($route) && !file_exists($route['path']) && !$this->authorative)
        {
            // A non-existing file was found in the cache - flush the cache and
            // try again.
            $this->clearCache();
            $root = $this->getRoutes();
            $route = $root->resolve($parts, $ext);
        }

        if ($route === null)
            self::$logger->info("Failed to resolve route for request to {0}", [$request]);
        else
            self::$logger->debug("Resolved route for {route} to {path} (module: {module})", $route);

        return $route;
    }
public function resolve(string $request)
    {
        $parts = array_filter(explode("/", $request));

        // Determine the file extension
        $last_part = end($parts);
        $dpos = strrpos($last_part, '.');
        if (!empty($dpos)) // If a dot exists after the first character
            $ext = substr($last_part, $dpos);
        else
            $ext = "";

        $root = $this->getRoutes();

        $route = $root->resolve($parts, $ext);

        if (!empty($route) && !file_exists($route['path']) && !$this->authorative)
        {
            // A non-existing file was found in the cache - flush the cache and
            // try again.
            $this->clearCache();
            $root = $this->getRoutes();
            $route = $root->resolve($parts, $ext);
        }

        if ($route === null)
            self::$logger->info("Failed to resolve route for request to {0}", [$request]);
        else
            self::$logger->debug("Resolved route for {route} to {path} (module: {module})", $route);

        return $route;
    }
Resolve an controller / route.
@param string $request string The incoming request

@return array An array containing:
'path' => The file that best matches the route
'route' => The part of the request that matches
'module' => The source module for the controller
'remainder' => Arguments object with the unmatched part of the request