diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-08-21 18:46:34 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-08-21 18:46:34 -0400 |
commit | 8e83e404fbb1d0dc770e5b41fa315a674541459a (patch) | |
tree | 38186a4ef5818133489b41f85f200fa28bed2806 /app/Core/Plugin/Installer.php | |
parent | 836e93546355e20f5a3cca0e2fd4e649264ce7ac (diff) |
Add FileCache driver
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); - } } |