aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_versions/lib/Storage.php
Commit message (Collapse)AuthorAgeFilesLines
* chore: run rectorrector-phpunit10Robin Appelman2025-07-011-2/+3
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* chore: apply new CSFixer rulesFerdinand Thiessen2025-07-011-0/+1
| | | | | | | Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de> # Conflicts: # apps/settings/lib/SetupChecks/PhpOpcacheSetup.php
* fix(files_versions): only close stream if still open, fixing S3fix/s3-versionsFerdinand Thiessen2025-05-181-1/+7
| | | | Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* fix(files_version): use `Storage::writeStream` instead of deprecated ↵chore/move-stream-copy-implementationFerdinand Thiessen2025-05-161-4/+16
| | | | | | `streamCopy` if possible Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* chore: move streamCopy implementation from `OC_Helper` to `OCP\Files`Ferdinand Thiessen2025-05-161-2/+5
| | | | | | | | | The function was already there but called the legacy version. So moved the implementation and migrated all usages of it. Sadly the interface was slightly different so adjusted it to be compatible with both legacy and the OCP one. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* fix(files_versions): Do not expire versions newer than min ageartonge/fix/min_age_rentention_files_versionsLouis Chemineau2025-02-191-1/+9
| | | | | | | | The auto expire logic does not take into account the min retention age set by the admin. So versions were eagerly deleted. Fix https://github.com/nextcloud/server/issues/19791 Signed-off-by: Louis Chemineau <louis@chmn.me>
* chore: Apply new rector configuration to apps folderCôme Chilliet2025-02-131-20/+20
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix(files_versions): Update `unencrypted_size` during rollbackartonge/fix/restoring_encrypted_versionLouis Chemineau2025-01-281-1/+2
| | | | | | This prevent restored version of encrypted files from having a wrong reported size. This was blocking download. Signed-off-by: Louis Chemineau <louis@chmn.me>
* chore(files_versions): Remove unused $node variableLouis Chemineau2025-01-281-2/+0
| | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* refactor(apps): Use constructor property promotion when possibleprovokateurin2024-10-211-1/+1
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* chore(apps): Apply new rector configuration to autouse classesCôme Chilliet2024-10-151-4/+7
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* chore(deps): Update nextcloud/coding-standard to v1.3.1provokateurin2024-09-191-17/+17
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* style: update codestyle for coding-standard 1.2.3Daniel Kesselberg2024-08-251-13/+13
| | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* fix: add a try and catch for delete versioninggreta2024-07-251-2/+7
| | | | Signed-off-by: greta <gretadoci@gmail.com>
* fix(files_versions): avoid unintentional skipping of expirationcarhe2024-07-251-1/+1
| | | Signed-off-by: carhe <carstenherrmann@web.de>
* chore: Add SPDX headerAndy Scherzinger2024-06-021-36/+3
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* chore(files_versions): Use new metadata API for versionsLouis Chemineau2024-03-131-2/+2
| | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* perf: switch places that always use the first getById result to getFirstNodeByIdRobin Appelman2024-03-041-3/+3
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* handle storage not available when expiring versionsRobin Appelman2024-01-241-0/+5
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* chore: apply changes from Nextcloud coding standards 1.1.1Joas Schilling2023-11-231-5/+5
| | | | | Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
* fix: Delete ghost versions of non-existing filesGit'Fellow2023-10-281-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-141-0/+15
| | | | Signed-off-by: Julius Härtl <jus@bitgrid.net>
* Fix initialisation of versions in the DBLouis Chemineau2023-05-251-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>