public function delete_file_dir($path, &$list) { $system_path = system_path($path); if (is_dir($system_path)) { $handle = opendir($system_path); if (!$handle) { array_push($list, array('status' => false, 'path' => $path, 'type' => 'dir')); return false; } while ($file = readdir($handle)) { if ($file == "." || $file == "..") { continue; } if (!$this->delete_file_dir($path . "/" . porgram_path($file), $list)) { return false; } } closedir($handle); $status = @rmdir($system_path); array_push($list, array('status' => $status, 'path' => $path, 'type' => 'dir')); if (!$status) { return false; } } elseif (is_file($system_path)) { if (!is_writeable($system_path) || !@unlink($system_path)) { array_push($list, array('status' => false, 'path' => $path, 'type' => 'file')); return false; } } return true; }
public function conv_path_to_system($path, $arr) { foreach ($arr as $id => $v) { $arr[$id] = system_path($this->do_path($path . "/" . $v)); } return $arr; }