优化path工具类

This commit is contained in:
2022-12-30 13:41:25 +08:00
parent 9cbfc5938c
commit 605d2396c9

View File

@@ -38,9 +38,13 @@ class PathTools
return self::intiDir($runtime_path);
}
public static function intiDir($file_path)
public static function intiDir($file_path, $is_dirname = false)
{
if (!$is_dirname) {
$dir_name = dirname($file_path);
} else {
$dir_name = $file_path;
}
if (!is_dir($dir_name)) {
mkdir($dir_name, 0777, true);