diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-03-18 17:14:38 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-03-18 17:14:38 +0100 |
commit | 6b9ae27b90ee5649fcab2417ebaf14e87559756e (patch) | |
tree | a5ce01aee8c99e2d4a37c1f090c7a1d82443af41 /apps/files/ajax | |
parent | f6c3667efa32d0fa24307b3acc3a239081bf6410 (diff) | |
download | nextcloud-server-6b9ae27b90ee5649fcab2417ebaf14e87559756e.tar.gz nextcloud-server-6b9ae27b90ee5649fcab2417ebaf14e87559756e.zip |
drop file cache migration OC5 -> OC6
Diffstat (limited to 'apps/files/ajax')
-rw-r--r-- | apps/files/ajax/upgrade.php | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/apps/files/ajax/upgrade.php b/apps/files/ajax/upgrade.php deleted file mode 100644 index 7237b02c0b0..00000000000 --- a/apps/files/ajax/upgrade.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -set_time_limit(0); //scanning can take ages -session_write_close(); - -$user = OC_User::getUser(); -$eventSource = new OC_EventSource(); -$listener = new UpgradeListener($eventSource); -$legacy = new \OC\Files\Cache\Legacy($user); - -if ($legacy->hasItems()) { - OC_Hook::connect('\OC\Files\Cache\Upgrade', 'migrate_path', $listener, 'upgradePath'); - - OC_DB::beginTransaction(); - $upgrade = new \OC\Files\Cache\Upgrade($legacy); - $count = $legacy->getCount(); - $eventSource->send('total', $count); - $upgrade->upgradePath('/' . $user . '/files'); - OC_DB::commit(); -} -\OC\Files\Cache\Upgrade::upgradeDone($user); -$eventSource->send('done', true); -$eventSource->close(); - -class UpgradeListener { - /** - * @var OC_EventSource $eventSource - */ - private $eventSource; - - private $count = 0; - private $lastSend = 0; - - public function __construct($eventSource) { - $this->eventSource = $eventSource; - } - - public function upgradePath($path) { - $this->count++; - if ($this->count > ($this->lastSend + 5)) { - $this->lastSend = $this->count; - $this->eventSource->send('count', $this->count); - } - } -} |