diff --git a/app/Plugin.php b/app/Plugin.php index b3b6c9c3..a2327d5d 100644 --- a/app/Plugin.php +++ b/app/Plugin.php @@ -212,7 +212,11 @@ public function handleRemove() { } $this->removePreferences(); - sp_remove_dir(base_path("app/Plugins/$this->name")); + + $pluginDir = base_path("app/Plugins/$this->name"); + if(File::exists($pluginDir)) { + File::deleteDirectory($pluginDir); + } $this->delete(); } diff --git a/app/helpers.php b/app/helpers.php index f9664e1c..1225731c 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -8,18 +8,6 @@ use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Storage; -if(!function_exists('sp_remove_dir')) { - function sp_remove_dir($dir) { - foreach(glob("{$dir}/*") as $file) { - if(is_dir($file)) { - sp_remove_dir($file); - } else if(!is_link($file)) { - unlink($file); - } - } - rmdir($dir); - } -} if(!function_exists('sp_slug')) { function sp_slug($str) {