";die(var_dump($path_errors));} } // This is how we scan directories static private function find_contents($dir){ $result = array(); $root = scandir($dir); foreach($root as $value){ if($value === '.' || $value === '..') {continue;} if(is_file($dir.DIRECTORY_SEPARATOR.$value)){ if(!self::$ext_filter || in_array(strtolower(pathinfo($dir.DIRECTORY_SEPARATOR.$value, PATHINFO_EXTENSION)), self::$ext_filter)){ self::$files[] = $result[] = $dir.DIRECTORY_SEPARATOR.$value; } continue; } if(self::$recursive){ foreach(self::find_contents($dir.DIRECTORY_SEPARATOR.$value) as $value) { self::$files[] = $result[] = $value; } } } // Return required for recursive search return $result; } } ?>