@param string $path

@throws \Exception when the included routes file doesn't return an AuraRouter back

@return AuraRouter
553571
protected function loadLaravelRoutes($path)
    {
        $router = (new LaravelRoutesLoader(
            new LaravelRouter(new Dispatcher())
        ))->load($path);
        $router->setModuleName($this->getName());

        return $router;
    }
710118
public function render(Path $path)
    {
        $html = null;
        $t = new TemplateLocator($path);
        foreach ($t->next() as $template) {
            $context = $this->buildContext($path, $template);

            // Skip template if no valid context could be created.
            if ($context === null) continue;

            // If abort() wasn't called in template, and it returned some HTML, we'll break and return this.
            $html = $this->renderOrAbort($template, $context);
            if ($html !== null) break;
        }
        if ($html === null) {
            // If no match is found, it might be that we're looking for an "index" model, so append "/index" adn try
            // again.
            $pathWithoutExt = explode('/', $path->getWithoutExtension());
            $fileWithoutExt = end($pathWithoutExt);
            if ($fileWithoutExt !== 'index') {
                return $this->render(new Path($path . '/index'));
            }

            // Nope, this really is a 404.
            return null;
        }

        // What ContentLoaders / Models were accessed during render?
        foreach ($this->resources as $modelName => $resource) {
            if ($resource->wasAccessed()) {
                $this->dispatcher->dispatch(
                    RenderDependencyEvent::NAME, new RenderDependencyEvent($modelName, $path)
                );
            }
        }

        $this->dispatcher
            ->dispatch(RenderEvent::NAME, new RenderEvent($path, $html));

        return $html;
    }
705166
public function getRoute($path = null)
    {
        // check the path
        if (!$path || ($this->path && $path != $this->path)){
            $urlParts = $this->urlPart;
        } else {
            $urlParts = $this->parsePath($path);
        }
        return $this->routeSystem->getRoute($urlParts);
    }
532977
protected function makeAbsolutePath($path)
    {
        $path = $this->serverUrlHelper->__invoke($this->basePathHelper->__invoke($path));
        return $path;
    }
1035665
public function lookup($path)
	{
		if($match = $this->_getRouteMatch($path,$this->_routes))
			return $match;

		if($match = $this->_getRouteMatch($path,$this->_customRoutes))
			return $match;

		throw new LookupException("No route matches path '$path'");
	}
1140595
public function save($path)
    {
        if ($this->error) {
            throw new Exception($this->message, $this->error);
        }
        $fp = @fopen($path, 'w');
        if ($fp === false) {
            throw new Exception('Failed to save the content', 500);
        }
        fwrite($fp, $this->data);
        fclose($fp);
        return $this;
    }
96885
public function file($path)
    {
        if (!isset($this->_baseDir)) {
            throw new App\Exception('Base directory not set');
        }
        return $this->_baseDir->file($path);
    }
1059656
private function getRouteArrayFromModulePath($path)
    {
        $path = dirname($path).'/config/routes.php';

        if (file_exists($path) && is_file($path)) {
            return require $path;
        } 
        
        return array();
    }
833233
public static function getContent($path)
    {
        if (is_dir($path)) {
            $files = array_diff(scandir($path), array('.', '..'));

            return $files;
        } else {
            throw new \Exception(sprintf('Incorrect path "%s" name in %s at line %s', $path, __FILE__, __LINE__));
        }
    }
392677
public function matchAutoRoute(string $path)
    {
        if (!$cnp = \trim($this->controllerNamespace)) {
            return false;
        }

        $sfx = \trim($this->controllerSuffix);

        return RouteHelper::parseAutoRoute($path, $cnp, $sfx);
    }
1028655
protected function parsePath($path)
    {
        $path = parse_url(substr(strstr(";" . $path, ";" . $this->basepath), strlen(";" . $this->basepath)), PHP_URL_PATH);

        if ($path === false) {
            throw new Exception("Seriously malformed URL passed to route matcher.");
        }

        return $path;
    }
1273902
protected function loadRoutesFrom($path)
    {
        $router = $this->app[WsRouter::class];
        if (is_null($this->namespace)) {
            return require $path;
        }
        $router->group(['namespace' => $this->namespace], function ($router) use ($path) {
            require $path;
        });
    }
829343
public function reroute($path) {

        if (strpos($path,'://') === false) {
            if (substr($path,0,1)!='/'){
                $path = '/'.$path;
            }
            $path = $this->routeUrl($path);
        }

        header('Location: '.$path);
        $this->stop();
    }
852029
public function getConfigurationOverride($path)
    {
        $validPath = DauxHelper::findLocation($path, $this->local_base, 'DAUX_CONFIGURATION', 'file');

        if ($validPath === null) {
            return null;
        }

        if (!$validPath) {
            throw new Exception('The configuration override file does not exist. Check the path again : ' . $path);
        }

        return $validPath;
    }
299570
public function directoryAction($path)
    {
        try {
            $this->setPath($path);
        } catch (NotFoundException $e) {
            throw $e;
        }

        $dbfile = new WDBFile($this->getpath());
        if ($dbfile->isFile()) {
            return $this->fileAction($this->getPath());
        }

        $readme_content = $dir_content = '';

        $index = $dbfile->findIndex();
        if (file_exists($index)) {
            return $this->fileAction($index);
        }

        $tpl_params = array(
            'page'          => $dbfile->getWDBFullStack(),
            'dirscan'       => $dbfile->getWDBScanStack(),
            'breadcrumbs'   => TemplateHelper::getBreadcrumbs($this->getPath()),
            'title'         => TemplateHelper::buildPageTitle($this->getPath()),
        );
        if (empty($tpl_params['title'])) {
            if (!empty($tpl_params['breadcrumbs'])) {
                $tpl_params['title'] = TemplateHelper::buildPageTitle(end($tpl_params['breadcrumbs']));
            } else {
                $tpl_params['title'] = _T('Home');
            }
        }

        $readme = $dbfile->findReadme();
        if (file_exists($readme)) {
            $this->wdb->setInputFile($readme);
            $readme_dbfile  = new WDBFile($readme);
            $readme_content = $readme_dbfile->viewFileInfos();
        }
        $tpl_params['inpage_menu']  = !empty($readme_content) ? 'true' : 'false';

        $dir_content = $this->wdb
            ->display('', 'dirindex', $tpl_params);

        return array('default', $dir_content.$readme_content, $tpl_params);
    }
1099546
public function dispatch($path) {

            $found  = false;
            $params = [];

            if (isset($this->routes[$path])) {

                $found = $this->render_route($path, $params);

            } else {

                foreach ($this->routes as $route => $callback) {

                    $params = [];

                    /* e.g. #\.html$#  */
                    if (substr($route,0,1)=='#' && substr($route,-1)=='#'){

                        if (preg_match($route, $path, $matches)){
                            $params[':captures'] = array_slice($matches, 1);
                            $found = $this->render_route($route, $params);
                            break;
                        }
                    }

                    /* e.g. /admin/*  */
                    if (strpos($route, '*') !== false){

                        $pattern = '#^'.str_replace('\*', '(.*)', preg_quote($route, '#')).'#';

                        if (preg_match($pattern, $path, $matches)){

                            $params[':splat'] = array_slice($matches, 1);
                            $found = $this->render_route($route, $params);
                            break;
                        }
                    }

                    /* e.g. /admin/:id  */
                    if (strpos($route, ':') !== false){

                        $parts_p = explode('/', $path);
                        $parts_r = explode('/', $route);

                        if (count($parts_p) == count($parts_r)){

                            $matched = true;

                            foreach($parts_r as $index => $part){
                                if (':' === substr($part,0,1)) {
                                    $params[substr($part,1)] = $parts_p[$index];
                                    continue;
                                }

                                if ($parts_p[$index] != $parts_r[$index]) {
                                    $matched = false;
                                    break;
                                }
                            }

                            if ($matched){
                                $found = $this->render_route($route, $params);
                                break;
                            }
                        }
                    }
                }
            }

            return $found;
    }
3688
public function includePaths($path)
	{
		$paths = is_array($path) ? $path : array($path);
		$this->_paths = array_merge($paths,$this->_paths);
		return $this;
	}