aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Cache/Cache.php
Commit message (Collapse)AuthorAgeFilesLines
* fix: always set storage id in Cache::getRobin Appelman2024-07-171-2/+2
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix: add set storage id for more cache queriesRobin Appelman2024-07-171-0/+5
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* feat: add base class for extending the query builderRobin Appelman2024-07-121-3/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix: get child ids for folder in a separate query during moveRobin Appelman2024-06-131-4/+21
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix(files): Use isRetryable to catch retryable exceptionsLouis Chemineau2024-06-111-2/+6
| | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* chore: Add SPDX headerAndy Scherzinger2024-05-241-37/+4
| | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* perf(db): Sort data for IN before chunkingChristoph Wurst2024-04-261-0/+3
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #43574 from nextcloud/enh/noid/lazyappconfig-migrate-metadataMaxence Lange2024-04-171-2/+2
|\ | | | | enh(metadata): migrate metadata to lazy appconfig
| * migrate metadata to lazy appconfigMaxence Lange2024-02-141-2/+2
| | | | | | Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
* | fix: Apply new coding standard to all filesCôme Chilliet2024-04-021-1/+1
| | | | | | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | feat(files)): Add retry logic to cover deadlock situations when moving many ↵Louis Chemineau2024-03-281-6/+25
| | | | | | | | | | | | files Signed-off-by: Louis Chemineau <louis@chmn.me>
* | fix(filecache): Move from array_merge to avoid memory exhaustionGit'Fellow2024-03-041-2/+7
|/ | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
* improve di performance for cacheRobin Appelman2024-02-091-44/+36
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Merge pull request #41272 from nextcloud/fixOccScansGit'Fellow2023-11-281-3/+6
|\ | | | | fix: reduce memory consumption of scans
| * fix: reduce memory consumption of scansGit'Fellow2023-11-031-3/+6
| | | | | | | | | | | | | | | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> Fix lint Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
* | chore: apply changes from Nextcloud coding standards 1.1.1Joas Schilling2023-11-231-1/+1
| | | | | | | | | | Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
* | refactor: Repalce array_search with in_array in lib/Christoph Wurst2023-11-221-2/+2
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | ignore metadata if table is emptyMaxence Lange2023-11-141-2/+2
| | | | | | Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
* | Support getting and setting metadata in DAV requestsLouis Chemineau2023-11-081-2/+9
|/ | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* fix: Prevent PHP warnings when optional CacheEntry attributes are unsetFerdinand Thiessen2023-08-161-1/+1
| | | | Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* select the fileid first when looking for incomplete filesRobin Appelman2023-08-141-5/+9
| | | | | | this seems to improve mariadbs index selection Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix: simplify `sourceData` checkJohn Molakvoæ2023-08-051-1/+1
| | | | Co-authored-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
* Catch more invalid cache source storage pathsJosh Richards2023-08-031-1/+1
| | | | | | | | | | OC\Files\Cache\Cache::get can return string|false|null, not just string|false. - nextcloud/server#26270 added handling of false, but null is needed too. - Well, or we change the default $resullt to false, but I'm not sure if that has other ramifications and the real need here is to simply catch situations where the cache source storage path is not valid for whatever reason Related: nextcloud/server#19009 Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
* chore: Replace \OC::$server->query with \OCP\Server::get in /libChristoph Wurst2023-07-061-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* chore: Drop dead private methods in /libChristoph Wurst2023-06-061-13/+0
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #38261 from fsamapoor/replace_strpos_calls_in_lib_privateRobin Appelman2023-06-011-1/+1
|\ | | | | Refactors "strpos" calls in lib/private to improve code readability.
| * Refactors "strpos" calls in lib/private to improve code readability.Faraz Samapoor2023-05-151-1/+1
| | | | | | | | Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
* | Fix return types in phpdocCôme Chilliet2023-05-151-1/+1
| | | | | | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* | Get rid of more int casts in file size manipulationsCôme Chilliet2023-05-111-6/+7
|/ | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* fix type hintsRobin Appelman2023-04-041-5/+3
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix unencrypted folder size when no children with unencrypted size set are leftRobin Appelman2023-04-041-1/+24
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix unencrypted_size for folders when scanning the filesystem with ↵Robin Appelman2023-04-041-3/+5
| | | | | | encryption enabled Signed-off-by: Robin Appelman <robin@icewind.nl>
* clear encrypted flag when moving away from encrypted storageRobin Appelman2023-04-011-0/+22
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Merge pull request #34773 from ↵Côme Chilliet2023-03-211-1/+19
|\ | | | | | | | | nextcloud/artonge/feat/dispatch_entry_removed_event_for_all_entries Dispatch event for all removed entries
| * Dispatch event for all remove entryLouis Chemineau2023-01-311-1/+19
| | | | | | | | Signed-off-by: Louis Chemineau <louis@chmn.me>
* | Make sure name and path are stringsJoas Schilling2023-02-021-0/+2
| | | | | | | | | | | | | | Otherwise Oracle returns NULL for empty strings and PHP 8.2 throws on null in string functions like trim() and md5() Signed-off-by: Joas Schilling <coding@schilljs.com>
* | Try fixing OracleJoas Schilling2023-02-021-1/+6
|/ | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* fix updating size when folder is emptyRobin Appelman2022-08-161-13/+17
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* store unencrypted size in the unencrypted_size columnRobin Appelman2022-08-161-8/+39
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Revert "store unencrypted size in the unencrypted_size column"Robin Appelman2022-08-161-30/+5
| | | | | | This reverts commit 8238582e59b7b6ec03318bcf81bf47cce54af320. Signed-off-by: Robin Appelman <robin@icewind.nl>
* Fix dynamic property creations in test filesCôme Chilliet2022-08-011-1/+1
| | | | | | This fixes warnings in PHP 8.2 Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Fix typos in lib/private subdirectoryluz paz2022-07-271-2/+2
| | | | | | Found via `codespell -q 3 -S l10n -L jus ./lib/private` Signed-off-by: luz paz <luzpaz@github.com>
* Check whether entry is of type ICacheEntry in Cache->remove()Jonas2022-06-291-1/+1
| | | | | | | | | | | | | In some scenarios (file not in cache, but partial data of it in the object), Cache->get() might return an array, which leads to errors like "Call to a member function getId() on array". So check whether the returned entry is of type ICacheEntry before doing operations on it in Cache->remove(). Fixes: #33023 Signed-off-by: Jonas <jonas@freesources.org>
* store unencrypted size in the unencrypted_size columnRobin Appelman2022-06-021-5/+30
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Adapt more code to migration to LoggerInterfaceCôme Chilliet2022-03-241-2/+3
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Switch logical operatorsacsfer2021-12-031-4/+4
| | | Unless there is a good reason to keep actual ones 👀
* Merge pull request #29281 from vijfhoek/masterJohn Molakvoæ2021-11-011-4/+12
|\
| * Move query outside the loop and reduce chunk size to 1000Sijmen Schoon2021-10-171-10/+12
| | | | | | | | | | | | | | This involved changing CacheQueryBuilder\whereParentIn to take a parameter name, renaming the function accordingly. Signed-off-by: Sijmen Schoon <me@sijmenschoon.nl>
| * Limit parameter count per query in Cache.removeChildrenSijmen Schoon2021-10-171-8/+14
| | | | | | | | Signed-off-by: Sijmen Schoon <me@sijmenschoon.nl>
* | Fix permissions when copying from ObjectStorageCarl Schwan2021-10-281-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | Make sure that when a user copy a file from a directory they don't have all permissions to a directory where they have more permissions, the permissions are correctly set to the one from the parent taget folder. This was caused by the ObjectStoreStorage::copyFromStorage using the jailed storage and cache entry instead of the unjailed one like other storages (the local one). Steps to reproduce + Use object storage + Create a groupfolder with one group having full permission and another one who can just read files. + With an user who is in the second group, copy a file from the groupfolder to the home folder of this user. + The file in the home folder of the user will be read only and can't be deleted even though it is in their home folder and they are the owner. In oc_filecache, the permissions stored for this file are 1 (READ) Signed-off-by: Carl Schwan <carl@carlschwan.eu>