summaryrefslogtreecommitdiffstats
path: root/apps/files/appinfo/update.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2012-05-16 15:59:36 +0200
committerArthur Schiwon <blizzz@owncloud.com>2012-05-16 15:59:36 +0200
commitfbc2892083c03329d4c64544a79ce143a97ce6bd (patch)
tree2e5976c4f0ad5c53159af5f633ff4f9d7689b95e /apps/files/appinfo/update.php
parentc04074692e1e97c5f249ec73e46b5ecd80ad19be (diff)
downloadnextcloud-server-fbc2892083c03329d4c64544a79ce143a97ce6bd.tar.gz
nextcloud-server-fbc2892083c03329d4c64544a79ce143a97ce6bd.zip
try to remove deprecated files from /files on update
Diffstat (limited to 'apps/files/appinfo/update.php')
-rw-r--r--apps/files/appinfo/update.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/apps/files/appinfo/update.php b/apps/files/appinfo/update.php
new file mode 100644
index 00000000000..f9953ba4de5
--- /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;
+ }
+}
+
+