Basic cleanup options added
This commit is contained in:
@@ -290,4 +290,22 @@ class optimizer
|
||||
|
||||
return $name;
|
||||
}
|
||||
|
||||
public static function cleanup_dir(string $dir, bool $recursion = false) : void
|
||||
{
|
||||
$dir = rtrim(str_replace("\\", "/", $dir), "/");
|
||||
$glob = glob(utils::globsafe($dir) . "/*");
|
||||
foreach ($glob as $file)
|
||||
{
|
||||
if (is_dir($file) && $recursion)
|
||||
{
|
||||
self::cleanup_dir($file, true);
|
||||
@rmdir($file);
|
||||
}
|
||||
else
|
||||
{
|
||||
unlink($file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -45,4 +45,9 @@ class optimizer_settings
|
||||
{
|
||||
return $this->osu_path;
|
||||
}
|
||||
|
||||
public function get_settings_path() : string
|
||||
{
|
||||
return $this->path;
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ class osu_library
|
||||
};
|
||||
}
|
||||
|
||||
$glob = glob($library_folder . "/*", GLOB_ONLYDIR);
|
||||
$glob = glob(utils::globsafe($library_folder) . "/*", GLOB_ONLYDIR);
|
||||
|
||||
natsort($glob); // i like wasting your processing power
|
||||
foreach($glob as $folder)
|
||||
|
||||
Reference in New Issue
Block a user