public function list_all_file($dir = '', $base_dir = '')
{
if (empty($dir)) {
$dir = NV_ROOTDIR . '/install/update';
}
$file_list = array();
if (is_dir($dir)) {
$array_filedir = scandir($dir);
foreach ($array_filedir as $v) {
if ($v == '.' or $v == '..') {
continue;
}
if (is_dir($dir . '/' . $v)) {
foreach ($this->list_all_file($dir . '/' . $v, $base_dir . '/' . $v) as $file) {
$file_list[] = $file;
}
} else {
// if( $base_dir == '' and ( $v == 'index.html' or $v == 'index.htm' ) ) continue; // Khong di chuyen index.html
$file_list[] = preg_replace('/^\\//', '', $base_dir . '/' . $v);
}
}
}
return $file_list;
}