diff options
Diffstat (limited to 'app/Core/Plugin/Installer.php')
-rw-r--r-- | app/Core/Plugin/Installer.php | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/app/Core/Plugin/Installer.php b/app/Core/Plugin/Installer.php index 48c4d978..b3618aeb 100644 --- a/app/Core/Plugin/Installer.php +++ b/app/Core/Plugin/Installer.php @@ -2,9 +2,8 @@ namespace Kanboard\Core\Plugin; -use RecursiveDirectoryIterator; -use RecursiveIteratorIterator; use ZipArchive; +use Kanboard\Core\Tool; /** * Class Installer @@ -64,7 +63,7 @@ class Installer extends \Kanboard\Core\Base throw new PluginInstallerException(e('You don\'t have the permission to remove this plugin.')); } - $this->removeAllDirectories($pluginFolder); + Tool::removeAllFiles($pluginFolder); } /** @@ -137,26 +136,4 @@ class Installer extends \Kanboard\Core\Base unlink($zip->filename); $zip->close(); } - - /** - * Remove recursively a directory - * - * @access protected - * @param string $directory - */ - protected function removeAllDirectories($directory) - { - $it = new RecursiveDirectoryIterator($directory, RecursiveDirectoryIterator::SKIP_DOTS); - $files = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST); - - foreach ($files as $file) { - if ($file->isDir()) { - rmdir($file->getRealPath()); - } else { - unlink($file->getRealPath()); - } - } - - rmdir($directory); - } } |