update.php 457 B

12345678910111213141516
  1. <?php
  2. $installedVersion=OCP\Config::getAppValue('files_versions', 'installed_version');
  3. // move versions to new directory
  4. if (version_compare($installedVersion, '1.0.2', '<')) {
  5. $users = \OCP\User::getUsers();
  6. $datadir = \OCP\Config::getSystemValue('datadirectory').'/';
  7. foreach ($users as $user) {
  8. $oldPath = $datadir.$user.'/versions';
  9. $newPath = $datadir.$user.'/files_versions';
  10. if(is_dir($oldPath)) {
  11. rename($oldPath, $newPath);
  12. }
  13. }
  14. }