summaryrefslogtreecommitdiffstats
path: root/apps/files_versions/lib/Storage.php
Commit message (Collapse)AuthorAgeFilesLines
* handle storage not available when expiring versionsRobin Appelman2024-01-251-0/+5
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix: Delete ghost versions of non-existing filesGit'Fellow2023-12-041-1/+4
| | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
* Move module versions management logic out of main logicLouis Chemineau2023-09-071-1/+1
| | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* fix: Also cleanup version metadata if expiringJulius Härtl2023-08-161-0/+15
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Fix initialisation of versions in the DBLouis Chemineau2023-05-301-0/+4
| | | | | | Broken after https://github.com/nextcloud/server/pull/36690 Signed-off-by: Louis Chemineau <louis@chmn.me>
* Check if version has entity before trying to access itGit'Fellow2023-05-121-1/+1
| | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
* Check if version entity is not null before deleteGit'Fellow2023-05-081-1/+6
| | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
* fix: catch ManuallyLockedException and use app contextMax2023-05-031-15/+17
| | | | | | | | | | | | The files_lock app may throw ManuallyLockedExceptions when attempting to revert a file that is currently opened. This would prevent the user from rolling back a opened file. Text and Richdocuments handle changes of the file while editing. Allow reverting files even when they are locked by these apps and let the apps handle the conflict. Signed-off-by: Max <max@nextcloud.com>
* Merge pull request #37428 from nextcloud/enh/ignore-non-numeric-versionsCôme Chilliet2023-04-201-1/+7
|\ | | | | Ignore and log non integer versions
| * Check for non-numeric versions, not non-integerCôme Chilliet2023-04-051-2/+2
| | | | | | | | | | | | All versions are string Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
| * Ignore and log non integer versionsCôme Chilliet2023-04-051-0/+6
| | | | | | | | | | | | | | | | This avoids being stuck when there is one buggy file version with a non-integer version. It allows the expiration process to not crash and continue with the other ones. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | fix: Make sure that rollback hook is triggered on all version backendsJulius Härtl2023-03-131-6/+0
|/ | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Handle empty DB while expiring versionsLouis Chemineau2023-02-081-4/+10
| | | | | | | | Version on the FS can have no equivalent in the DB if they were created before the version naming feature. This makes sure that we catch the resulting exception and proceed as usual. Fix https://github.com/nextcloud/server/issues/36541 Signed-off-by: Louis Chemineau <louis@chmn.me>
* Prevent expiration of named versionsLouis Chemineau2023-01-261-1/+22
| | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* Allow to delete a version through DAVLouis Chemineau2023-01-261-0/+11
| | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* Handle badly named version files more gracefully and log informationCôme Chilliet2022-10-111-5/+13
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* use filesystem user instead of file owner for creating versionRobin Appelman2022-09-091-1/+10
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* always use the default fs owner when storing versionsRobin Appelman2022-09-061-14/+27
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* cache internalpath in versions cleanupRobin Appelman2022-04-041-2/+3
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* use search to find versions to expireRobin Appelman2021-08-181-18/+43
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Remove allmost all deprecation from the files_version appCarl Schwan2021-07-231-17/+33
| | | | | | | | | | The remaining deprecations are related to Utils::hooks and I will take a look at how EventDispatcher works before working on them. Aside from the deprecations, this patch also does a few minor improvements around type hinting. Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-041-7/+0
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Drop \OCP\UserChristoph Wurst2021-05-211-3/+3
| | | | | | Inlines and remaining usages and drops the deprecated public API. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Bump nextcloud/coding-standard from 0.3.0 to 0.5.0dependabot-preview[bot]2021-02-181-12/+12
| | | | | | | | | | Bumps [nextcloud/coding-standard](https://github.com/nextcloud/coding-standard) from 0.3.0 to 0.5.0. - [Release notes](https://github.com/nextcloud/coding-standard/releases) - [Changelog](https://github.com/nextcloud/coding-standard/blob/master/CHANGELOG.md) - [Commits](https://github.com/nextcloud/coding-standard/compare/v0.3.0...v0.5.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* dont stop expiring versions if we cant check if the source file still existsRobin Appelman2021-02-051-2/+9
| | | | | | instead continue assuming it still exists Signed-off-by: Robin Appelman <robin@icewind.nl>
* Update all license headers for Nextcloud 21Christoph Wurst2020-12-161-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Return all keys in getAllVersions() insteadMorris Jobke2020-10-121-4/+7
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Fix undefined index and consequential damages in versions codeChristoph Wurst2020-10-121-1/+1
| | | | | | | | | | If the user has no space and there are no versions, there won't be an `all` index in the versions entry. Hence this triggers a warning and becomes `null`, afterwards `count`, `foreach` and friends will happily throw even more warnings and errors because they don't want to play with `null`. Thus adding a fallback to an empty array. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Format code to a single space around binary operatorsChristoph Wurst2020-10-051-5/+5
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headers for 19Christoph Wurst2020-04-291-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Fix #19066 - Array offset error due to empty file versions arrayLiam JACK2020-04-121-0/+5
| | | | Signed-off-by: Liam JACK <liamjack@users.noreply.github.com>
* Add visibility to all constantsChristoph Wurst2020-04-101-6/+6
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-101-11/+2
| | | | | | | | | | | | | | | 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-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Remove trailing and in between spacesChristoph Wurst2020-04-091-2/+2
| | | | 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-31/+31
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #18231 from nextcloud/fix/shared_version_restoreRoeland Jago Douma2019-12-091-10/+7
|\ | | | | Fix restoring shared versions
| * Fix restoring shared versionsRoeland Jago Douma2019-12-051-10/+7
| | | | | | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* | Update license headersChristoph Wurst2019-12-051-2/+4
|/ | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Do not create Application instances directlyChristoph Wurst2019-10-111-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Make sure we only fetch the file by id for the actual ownerJulius Härtl2019-08-011-1/+1
| | | | | | | Otherwise this will fetch all mounts for the file id which is quite expensive and causes long saving times in big sharing structures Signed-off-by: Julius Härtl <jus@bitgrid.net>
* set availableSpace to 0 if userFolder not foundFelix Nieuwenhuizen2019-03-021-6/+7
| | | | Signed-off-by: Felix Nieuwenhuizen <felix@tdlrali.com>
* use node API for free space calculation in versions app (same method as ↵Felix Nieuwenhuizen2019-03-021-3/+5
| | | | | | trashbin app) Signed-off-by: Felix Nieuwenhuizen <felix@tdlrali.com>
* modular versions apiRobin Appelman2018-11-011-14/+11
| | | | | | | Allows apps to register version backends for storage types The existing versions backend is wrapped in a "legacy" backend. Signed-off-by: Robin Appelman <robin@icewind.nl>
* Delete the previews when a version is restoredRoeland Jago Douma2018-05-141-0/+8
| | | | | | | | | Fixes #9469 When a version of a file is restored the previews are no longer valid. Thus we should remove them so they are regenerated. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Use more magic DI in files_versionsRoeland Jago Douma2018-05-111-1/+1
| | | | | | | There is no need to register this. The system can figure out by itself what it needs to do :) Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Less deprecated calls to OCP\Util::writeLogMorris Jobke2018-04-221-4/+5
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Use type casting instead of *val() methodMorris Jobke2018-01-261-1/+1
| | | | | | It should be up to 6x faster Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Merge pull request #8053 from nextcloud/simplify-substrJoas Schilling2018-01-261-1/+1
|\ | | | | Use short for of substr to not need strlen()