]> source.dussan.org Git - nextcloud-server.git/commitdiff
update script to fix fscache
authorBjoern Schiessle <schiessle@owncloud.com>
Fri, 13 Jul 2012 13:17:36 +0000 (15:17 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Fri, 13 Jul 2012 13:17:36 +0000 (15:17 +0200)
apps/files_sharing/appinfo/update.php [new file with mode: 0644]
apps/files_sharing/appinfo/version

diff --git a/apps/files_sharing/appinfo/update.php b/apps/files_sharing/appinfo/update.php
new file mode 100644 (file)
index 0000000..b43269d
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+
+// touch shared directories to trigger one-time re-scan for all users
+$datadir = \OCP\Config::getSystemValue('datadirectory');
+$currentVersion=OC_Appconfig::getValue('files_sharing', 'installed_version');
+if (version_compare($currentVersion, '0.2.2', '<')) {
+       if ($handle = opendir($datadir)) {\r
+               while (false !== ($entry = readdir($handle))) {\r
+                       $sharedFolder = $datadir.'/'.$entry.'/files/Shared';\r
+                       if ($entry != "." && $entry != ".." && is_dir($sharedFolder)) {\r
+                               touch($sharedFolder);\r
+                       }\r
+               }\r
+               closedir($handle);\r
+       }
+}
\ No newline at end of file
index 7dff5b8921122a487162febe3c8e32effb7acb35..f4778493c50025c6ab147a1fec7486ef0c706792 100644 (file)
@@ -1 +1 @@
-0.2.1
\ No newline at end of file
+0.2.2
\ No newline at end of file