summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/appinfo/update.php
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2012-07-13 15:17:36 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2012-07-13 15:17:36 +0200
commit50eef9a71cfa88ef4b1e5162a288f29410306c95 (patch)
treeabfd84f3e81e32d515f83c1e8946e5b9a23545a3 /apps/files_sharing/appinfo/update.php
parent80ed5412f10beafed0674c9942705f3f11a3c972 (diff)
downloadnextcloud-server-50eef9a71cfa88ef4b1e5162a288f29410306c95.tar.gz
nextcloud-server-50eef9a71cfa88ef4b1e5162a288f29410306c95.zip
update script to fix fscache
Diffstat (limited to 'apps/files_sharing/appinfo/update.php')
-rw-r--r--apps/files_sharing/appinfo/update.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/files_sharing/appinfo/update.php b/apps/files_sharing/appinfo/update.php
new file mode 100644
index 00000000000..b43269d69f7
--- /dev/null
+++ b/apps/files_sharing/appinfo/update.php
@@ -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)) {
+ while (false !== ($entry = readdir($handle))) {
+ $sharedFolder = $datadir.'/'.$entry.'/files/Shared';
+ if ($entry != "." && $entry != ".." && is_dir($sharedFolder)) {
+ touch($sharedFolder);
+ }
+ }
+ closedir($handle);
+ }
+} \ No newline at end of file