summaryrefslogtreecommitdiff
path: root/app/Core/Plugin
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-08-21 18:46:34 -0400
committerFrederic Guillot <fred@kanboard.net>2016-08-21 18:46:34 -0400
commit8e83e404fbb1d0dc770e5b41fa315a674541459a (patch)
tree38186a4ef5818133489b41f85f200fa28bed2806 /app/Core/Plugin
parent836e93546355e20f5a3cca0e2fd4e649264ce7ac (diff)
Add FileCache driver
Diffstat (limited to 'app/Core/Plugin')
-rw-r--r--app/Core/Plugin/Installer.php27
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);
- }
}