fix indention

This commit is contained in:
Björn Schießle 2013-06-14 15:14:23 +02:00
parent f91b02e9b6
commit c3371812a0
1 changed files with 310 additions and 319 deletions

View File

@ -24,6 +24,7 @@ namespace OCA\Files_Trashbin;
class Trashbin {
// how long do we keep files in the trash bin if no other value is defined in the config file (unit: days)
const DEFAULT_RETENTION_OBLIGATION = 180;
// unit: percentage; 50% of available disk space/quota
@ -89,13 +90,11 @@ class Trashbin {
\OC_Log::write('files_trashbin', 'trash bin database couldn\'t be updated', \OC_log::ERROR);
return;
}
\OCP\Util::emitHook('\OCA\Files_Trashbin\Trashbin', 'post_moveToTrash',
array('filePath' => \OC\Files\Filesystem::normalizePath($file_path),
\OCP\Util::emitHook('\OCA\Files_Trashbin\Trashbin', 'post_moveToTrash', array('filePath' => \OC\Files\Filesystem::normalizePath($file_path),
'trashPath' => \OC\Files\Filesystem::normalizePath($filename . '.d' . $timestamp)));
$trashbinSize += self::retainVersions($view, $file_path, $filename, $timestamp);
$trashbinSize += self::retainEncryptionKeys($view, $file_path, $filename, $timestamp);
} else {
\OC_Log::write('files_trashbin', 'Couldn\'t move ' . $file_path . ' to the trash bin', \OC_log::ERROR);
}
@ -103,7 +102,6 @@ class Trashbin {
$trashbinSize -= self::expire($trashbinSize);
self::setTrashbinSize($user, $trashbinSize);
}
/**
@ -222,7 +220,6 @@ class Trashbin {
unlink($src);
}
}
}
// enable proxy
@ -293,8 +290,7 @@ class Trashbin {
$view->chroot('/' . $user . '/files');
$view->touch('/' . $location . '/' . $filename . $ext, $mtime);
$view->chroot($fakeRoot);
\OCP\Util::emitHook('\OCA\Files_Trashbin\Trashbin', 'post_restore',
array('filePath' => \OC\Files\Filesystem::normalizePath('/'.$location.'/'.$filename.$ext),
\OCP\Util::emitHook('\OCA\Files_Trashbin\Trashbin', 'post_restore', array('filePath' => \OC\Files\Filesystem::normalizePath('/' . $location . '/' . $filename . $ext),
'trashPath' => \OC\Files\Filesystem::normalizePath($file)));
if ($view->is_dir($target . $ext)) {
$trashbinSize -= self::calculateSize(new \OC\Files\View('/' . $user . '/' . $target . $ext));
@ -377,7 +373,6 @@ class Trashbin {
return $size;
}
/**
* @brief restore encryption keys from trash bin
*
@ -438,7 +433,6 @@ class Trashbin {
}
$size += self::calculateSize(new \OC\Files\View($sharekey));
$rootView->rename($sharekey, $owner . '/files_encryption/share-keys/' . $ownerPath);
} else {
// handle keyfiles
$size += $rootView->filesize($keyfile);
@ -666,8 +660,7 @@ class Trashbin {
$query = \OC_DB::prepare('SELECT `location`,`type`,`id`,`timestamp` FROM `*PREFIX*files_trash` WHERE `user`=?');
$result = $query->execute(array($user))->fetchAll();
$retention_obligation = \OC_Config::getValue('trashbin_retention_obligation',
self::DEFAULT_RETENTION_OBLIGATION);
$retention_obligation = \OC_Config::getValue('trashbin_retention_obligation', self::DEFAULT_RETENTION_OBLIGATION);
$limit = time() - ($retention_obligation * 86400);
@ -694,8 +687,6 @@ class Trashbin {
$size += $tmp;
$i++;
}
}
return $size;
@ -792,8 +783,7 @@ class Trashbin {
if (!file_exists($root)) {
return 0;
}
$iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($root),
\RecursiveIteratorIterator::CHILD_FIRST);
$iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($root), \RecursiveIteratorIterator::CHILD_FIRST);
$size = 0;
foreach ($iterator as $path) {
@ -845,4 +835,5 @@ class Trashbin {
//Listen to delete user signal
\OCP\Util::connectHook('OC_User', 'pre_deleteUser', "OCA\Files_Trashbin\Hooks", "deleteUser_hook");
}
}