-if ($_POST['download']) {
- if (!file_put_contents("cache/vendor.zip", fopen("http://wllbg.org/vendor", 'r'))) {
- $errors[] = 'Impossible to download vendor.zip. Please <a href="http://wllbg.org/vendor">download it here manually<∕a> and unzip it in your wallabag folder.';
+
+/* Function taken from at http://php.net/manual/en/function.rmdir.php#110489
+ * Idea : nbari at dalmp dot com
+ * Rights unknown
+ * Here in case of .gitignore files
+ */
+function delTree($dir) {
+ $files = array_diff(scandir($dir), array('.','..'));
+ foreach ($files as $file) {
+ (is_dir("$dir/$file")) ? delTree("$dir/$file") : unlink("$dir/$file");
+ }
+ return rmdir($dir);
+ }
+
+if (isset($_GET['clean'])) {
+ if (is_dir('install')){
+ delTree('install');
+ header('Location: index.php');
+ }
+}
+
+if (isset($_POST['download'])) {
+ if (!file_put_contents("cache/vendor.zip", fopen("http://static.wallabag.org/files/vendor.zip", 'r'))) {
+ $errors[] = 'Impossible to download vendor.zip. Please <a href="http://wllbg.org/vendor">download it manually</a> and unzip it in your wallabag folder.';