summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/appinfo/update.php
blob: feafa5fb9921b2538957b83bc0f219c016ad585d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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);
	}
}