This script is to get tree files and folder of a path fo directory
$generalRoutes = new DirectoryObj(dirname(dirname(FILE)) . DIRECTORY_SEPARATOR.'test'); foreach($generalRoutes->getFiles() as $route) { echo $route['path']; }
$robotRoutes = $robotObj->getFiles($robot['path'].'/test'); foreach($robotRoutes as $robotRoute) { echo $robotRoute['path']; }
- Each function return a array with include files information such as file/folder name and file/folder actual path
- Here dirname(dirname(FILE)) can be replace $_SERVER array path of a directory in host