public function testDeleteLoop() { $path = $this->path; global $delete_file_array; delete_loop($path); $files = get_recursive_file_list($path); $this->assertEquals(sizeof($delete_file_array), sizeof($files)); $this->assertEquals(array_slice($delete_file_array, 0, 5), array_slice($files, 0, 5)); }
/** * * Function delete loop * This function checks http security settings * @param string $path = path to the files we are deleting * @version 1.0 * @author Patrick Lockley */ function delete_loop($path) { global $likelihood_array, $delete_folder_array, $delete_file_array; $d = opendir($path); while ($f = readdir($d)) { if (is_dir($path . $f)) { if ($f != "." && $f != "..") { delete_loop($path . $f . "/"); array_push($delete_folder_array, $path . $f . "/"); } } else { array_push($delete_file_array, $path . $f); } } closedir($d); }