server/apps/files_versions/appinfo/update.php
2012-08-29 20:34:44 +02:00

15 lines
457 B
PHP

<?php
$installedVersion=OCP\Config::getAppValue('files_versions', 'installed_version');
// move versions to new directory
if (version_compare($installedVersion, '1.0.2', '<')) {
$users = \OCP\User::getUsers();
$datadir = \OCP\Config::getSystemValue('datadirectory').'/';
foreach ($users as $user) {
$oldPath = $datadir.$user.'/versions';
$newPath = $datadir.$user.'/files_versions';
if(is_dir($oldPath)) {
rename($oldPath, $newPath);
}
}
}