static function get_filesystem_method_dir($dir) { $result = gp_filesystem_base::get_filesystem_method_file($dir); if ($result === false) { return false; } $dh = @opendir($dir); if (!$dh) { return $result; } while (($file = readdir($dh)) !== false) { if (strpos($file, '.') === 0) { continue; } $fullPath = $dir . '/' . $file; if (is_link($fullPath)) { $temp_result = gp_filesystem_base::get_filesystem_method_link($fullPath); } elseif (is_dir($fullPath)) { $temp_result = gp_filesystem_base::get_filesystem_method_dir($fullPath); } else { $temp_result = gp_filesystem_base::get_filesystem_method_file($fullPath); } if ($temp_result === false) { return false; } $result = max($temp_result, $result); } return $result; }