From fbc2892083c03329d4c64544a79ce143a97ce6bd Mon Sep 17 00:00:00 2001
From: Arthur Schiwon <blizzz@owncloud.com>
Date: Wed, 16 May 2012 15:59:36 +0200
Subject: [PATCH] try to remove deprecated files from /files on update

---
 apps/files/appinfo/update.php | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 apps/files/appinfo/update.php

diff --git a/apps/files/appinfo/update.php b/apps/files/appinfo/update.php
new file mode 100644
index 0000000000..f9953ba4de
--- /dev/null
+++ b/apps/files/appinfo/update.php
@@ -0,0 +1,34 @@
+<?php
+
+//update from OC 3
+
+//try to remove remaining files.
+//Give a warning if not possible
+
+$filesToRemove = array(
+	'ajax',
+	'appinfo',
+	'css',
+	'js',
+	'l10n',
+	'templates',
+	'admin.php',
+	'download.php',
+	'index.php',
+	'settings.php'
+);
+
+foreach($filesToRemove as $file) {
+	$filepath = OC::$SERVERROOT . '/files/' . $file;
+	if(!file_exists($filepath)) {
+		continue;
+	}
+    $success = OCP\Files::rmdirr($filepath);
+    if($success === false) {
+		//probably not sufficient privileges, give up and give a message.
+		OCP\Util::writeLog('files','Could not clean /files/ directory. Please remove everything except webdav.php from ' . OC::$SERVERROOT . '/files/', OCP\Util::ERROR);
+		break;
+    }
+}
+
+
-- 
GitLab