summaryrefslogtreecommitdiffstats
path: root/apps/files_versions/lib/Storage.php
Commit message (Collapse)AuthorAgeFilesLines
* 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()
| * Use short for of substr to not need strlen()Morris Jobke2018-01-251-1/+1
| | | | | | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* | Use $var[] = $a instead of array_push - 2x fasterMorris Jobke2018-01-251-1/+1
|/ | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Update license headersMorris Jobke2017-11-061-1/+1
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* allow apps to disable versions for some filesBjoern Schiessle2017-09-151-0/+12
| | | | Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
* Remove undocumented configJoas Schilling2017-08-011-77/+73
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix versions appJoas Schilling2017-08-011-3/+3
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Fix comparisons in the versions appJoas Schilling2017-08-011-7/+7
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Use IConfig instead of static OCP\ConfigMorris Jobke2017-07-271-2/+2
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Properly expire ext storage versions (#26601)Vincent Petry2017-03-101-6/+15
| | | | | | | | | | | | | | | | | | * Properly expire ext storage versions System-wide external storages have no real owner so the current user is used as owner. However when running cron.php there is no current user, so no expiry can be done. This fix adds an user argument to the expire() function to tell for which user to expire files. This information is anyway always available now through the expire command job. * Move version expire setupFS into the expire function * Add comment about not tearing down in version Storage::expire() Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* Show mimeicon when versions don't have a previewRoeland Jago Douma2016-11-291-0/+1
| | | | | | Fixes #2413 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Moved over files_versionsRoeland Jago Douma2016-11-031-1/+1
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Update with robinJoas Schilling2016-07-211-1/+1
|
* Fix apps/Joas Schilling2016-07-211-2/+5
|
* Merge branch 'master' into sync-masterMorris Jobke2016-07-071-8/+12
|\
| * we don't need to check permissions twiceBjoern Schiessle2016-07-041-4/+2
| |
| * Merge remote-tracking branch 'upstream/master' into master-sync-upstreamLukas Reschke2016-07-011-0/+8
| |\
| * | check permissions before rollbackBjoern Schiessle2016-06-301-5/+11
| | |
* | | Upgrading the log level From Debug to INFO to be consistent with ↵Carlos Damken2016-07-061-3/+3
| |/ |/| | | | | files_trashbin (#25367)