original_string: 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;
  	}
code: 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;
  	}
code_tokens: 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 ; }
docstring: Recursively find all routes within path
docstring_tokens: Recursively find all routes within path