aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/lib/Trashbin.php
Commit message (Collapse)AuthorAgeFilesLines
* feat: add base class for extending the query builderRobin Appelman2024-07-121-4/+4
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* chore: Add SPDX headerAndy Scherzinger2024-06-021-41/+3
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* chore(trashbin): Add method to get deleted by from trash itemChristopher Ng2024-04-231-9/+8
| | | | Signed-off-by: Christopher Ng <chrng8@gmail.com>
* chore(trashbin): Store deleted by userChristopher Ng2024-04-231-2/+4
| | | | Signed-off-by: Christopher Ng <chrng8@gmail.com>
* chore: Replace OC::$server->getL10N by OCP\Util::getL10N in lib and some appsCôme Chilliet2024-02-051-1/+1
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Synchronize operation on live photo filesLouis Chemineau2023-11-291-4/+61
| | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* chore: apply changes from Nextcloud coding standards 1.1.1Joas Schilling2023-11-231-2/+2
| | | | | Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
* Support getting and setting metadata in DAV requestsLouis Chemineau2023-11-081-1/+3
| | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* Correctly react to bad configurationCôme Chilliet2023-06-081-13/+23
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Do not cast sizes to int in Trashbin classCôme Chilliet2023-06-081-29/+24
| | | | | | This helps with 32bits support Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix(trashbin): Truncate long filenamesChristopher Ng2023-05-311-14/+33
| | | | Signed-off-by: Christopher Ng <chrng8@gmail.com>
* fix(files_trashbin): Remove unnecessary scanner logic when getting versions ↵Julius Härtl2023-02-021-24/+0
| | | | | | from trash Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Fix typos in apps/ subdirectoryluz paz2022-09-051-1/+1
| | | | | | | Found via `codespell -q 3 -S l10n,./apps/files_external/3rdparty -L adn,ba,boxs,keypair,jus,optionel,ressource,tabel ./apps/` Signed-off-by: luz paz <luzpaz@github.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
* Remove OCP\App and OCP\BackgroundJobCarl Schwan2022-08-011-3/+4
| | | | | | | | | | Both deprecated since NC 23 IAppManager is the replacement for OCP\App unfortunately it can't be dependency injected in classes used by the installed otherwise the database connection is initialised too early Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* use size from cache to determine whether to skip the trashbinRobin Appelman2022-06-291-5/+11
| | | | | | this way large folders also get skipped Signed-off-by: Robin Appelman <robin@icewind.nl>
* Fix psalm errors fron the end of the baseline fileCarl Schwan2022-05-161-1/+1
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Adapt more code to migration to LoggerInterfaceCôme Chilliet2022-03-241-8/+14
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Don't die with LockedException when removing/restoring multiple files from trashSven Strickroth2021-08-191-3/+14
| | | | | | fixes issue #16491 Signed-off-by: Sven Strickroth <email@cs-ware.de>
* rework search api to allow searching on multiple caches at onceRobin Appelman2021-06-141-3/+2
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-041-1/+0
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Drop \OCP\UserChristoph Wurst2021-05-211-8/+8
| | | | | | Inlines and remaining usages and drops the deprecated public API. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix usage of rename executeUpdateChristoph Wurst2021-05-051-6/+6
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Cleanp execute usage in the trashbinRoeland Jago Douma2021-03-111-9/+9
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Update all license headers for Nextcloud 21Christoph Wurst2020-12-161-1/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Don't leave cursors open when tests failJoas Schilling2020-11-091-1/+5
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Use query builder instead of OC_DB in trashbinJoas Schilling2020-11-061-21/+56
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Restrict query when searching for versions of trashbin filesJulius Härtl2020-10-141-14/+43
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* dont hold a transaction during the move to trashRobin Appelman2020-09-301-5/+7
| | | | | | because moving to trash can take a long time, keeping a transaction active for the duration can lead to issues Signed-off-by: Robin Appelman <robin@icewind.nl>
* Delete files that exceed trashbin size immediatelyJulius Härtl2020-09-231-0/+8
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Update license headers for Nextcloud 20 (again)Christoph Wurst2020-09-071-0/+1
| | | | | | | There are still lots of outdated headers, so time for another round of updates. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Change free space calculationDaniel Kesselberg2020-08-311-4/+6
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* Merge pull request #21954 from nextcloud/techdebt/noid/bootstrap-files_trashbinblizzz2020-08-071-14/+0
|\ | | | | Use IBootstrap for the files_trashbin app
| * Use IBootstrap for the files_trashbin appMorris Jobke2020-07-231-14/+0
| | | | | | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* | fix object store trashbin handlingRobin Appelman2020-07-301-3/+10
| | | | | | | | | | | | object stores are "special" given how they interact with the cache on their own Signed-off-by: Robin Appelman <robin@icewind.nl>
* | rollback cache rename if trashbin move failsRobin Appelman2020-07-231-0/+5
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | fix moving files from external storage to object store trashbinRobin Appelman2020-07-231-2/+2
|/ | | | | | | | | | | | having the "cache rename" after the "storage move" caused the target to get the fileid from the source file, without taking care that the object is stored under the original file id. By doing the "cache rename" first, we trigger the "update existing file" logic while moving the file to the object store and the object gets stored for the correct file id Signed-off-by: Robin Appelman <robin@icewind.nl>
* allow admin to configure the max trashbin sizeRobin Appelman2020-07-071-0/+10
| | | | | | | | this allows an admin to configure the max trashbin size instead of always relying on the users quota. The trashbin size can be configured using the `occ trash:size` command and can be set both globally and per-user Signed-off-by: Robin Appelman <robin@icewind.nl>
* add locking to resolve concurent move to trashbin conflictsRobin Appelman2020-05-061-13/+39
| | | | | | | uses a lock to prevent two requests from moving a file to the trashbin concurrently (causing sql duplicate key errors) Signed-off-by: Robin Appelman <robin@icewind.nl>
* Add visibility to all constantsChristoph Wurst2020-04-101-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-101-11/+5
| | | | | | | | | | | | | | | To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use elseif instead of else ifChristoph Wurst2020-04-101-4/+4
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Unify function spacing to PSR2 recommendationChristoph Wurst2020-04-091-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the short array syntax, everywhereChristoph Wurst2020-03-261-22/+22
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headersChristoph Wurst2019-12-051-2/+4
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* set retention obligation on existing `expiration` in testsRobin Appelman2019-11-041-3/+2
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Do not create Application instances directlyChristoph Wurst2019-10-111-3/+6
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update apps/files_trashbin/lib/Trashbin.phpRobin Appelman2019-09-041-1/+3
| | | Co-Authored-By: Morris Jobke <hey@morrisjobke.de>
* dont try to copy trash items to user if the user has not enough free spaceRobin Appelman2019-07-291-1/+4
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* dont try to restore a trashbin item to a readonly targetRobin Appelman2019-03-141-0/+4
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Only fetch size of this storage without mount points - ref #14412Morris Jobke2019-03-011-1/+1
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>