src/Host.php
protected function scanRoutes($root, $realRoot=NULL) {
		if($realRoot === NULL) $realRoot = $root;
		$result = array();

		$all = glob($root.'/*'); /* */
		foreach($all as $path) {
			if(!is_dir($path)) {
				// This is an endpoint
				$res = $this->createRouteFromFile($realRoot, $path);
				if($res)
					$result[] = $res;
			} else {
				$res = $this->scanRoutes($path, $realRoot);
				foreach($res as $route)
					$result[] = $route;
			}
		}
		return $result;
	}
protected function scanRoutes($root, $realRoot=NULL) {
		if($realRoot === NULL) $realRoot = $root;
		$result = array();

		$all = glob($root.'/*'); /* */
		foreach($all as $path) {
			if(!is_dir($path)) {
				// This is an endpoint
				$res = $this->createRouteFromFile($realRoot, $path);
				if($res)
					$result[] = $res;
			} else {
				$res = $this->scanRoutes($path, $realRoot);
				foreach($res as $route)
					$result[] = $route;
			}
		}
		return $result;
	}
protected function scanRoutes ( $ root , $ realRoot = NULL ) { if ( $ realRoot === NULL ) $ realRoot = $ root ; $ result = array ( ) ; $ all = glob ( $ root . '/*' ) ; /* */ foreach ( $ all as $ path ) { if ( ! is_dir ( $ path ) ) { // This is an endpoint $ res = $ this -> createRouteFromFile ( $ realRoot , $ path ) ; if ( $ res ) $ result [ ] = $ res ; } else { $ res = $ this -> scanRoutes ( $ path , $ realRoot ) ; foreach ( $ res as $ route ) $ result [ ] = $ route ; } } return $ result ; }
Recursively find all routes within path
Recursively find all routes within path