aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Cache/Cache.php
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* Remove some mentions of ownCloud from our api documentationCarl Schwan2021-07-291-2/+2
| | | | Signed-off-by: Carl Schwan <carl@carlschwan.eu>
* inject SearchBuilderRobin Appelman2021-06-141-6/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* perform file search in a single queryRobin Appelman2021-06-141-1/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* use searchoperation for storage filter instead of db expressionRobin Appelman2021-06-141-2/+3
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* rework search api to allow searching on multiple caches at onceRobin Appelman2021-06-141-103/+37
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-041-1/+1
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Catch invalid cache source storage pathJohn Molakvoæ (skjnldsv)2021-03-241-0/+4
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* only require user to be set in a query that handles tagsRobin Appelman2021-03-181-4/+8
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Merge pull request #26013 from nextcloud/object-store-copy-cache-idRobin Appelman2021-03-161-1/+44
|\ | | | | Return the fileid from `copyFromCache` and use it instead of doing an extra query
| * verify that cache entry is validRobin Appelman2021-03-121-0/+3
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
| * add ICopyFromCache trait to expose existing implementationRobin Appelman2021-03-121-1/+41
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | do cachejail search filtering in sqlRobin Appelman2021-01-261-1/+1
|/ | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Bump doctrine/dbal from 2.12.0 to 3.0.0Christoph Wurst2021-01-081-9/+11
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headersChristoph Wurst2020-12-301-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #24715 from nextcloud/bug/noid/limit-get-incomplete-to-1Roeland Jago Douma2020-12-211-1/+2
|\ | | | | Limit getIncomplete query to one row
| * Limit getIncomplete query to one rowDaniel Kesselberg2020-12-151-1/+2
| | | | | | | | Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
* | Update all license headers for Nextcloud 21Christoph Wurst2020-12-161-1/+1
|/ | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* code style and dispatchTypedRobin Appelman2020-12-021-2/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* rename cache event to follow new naming standardsRobin Appelman2020-11-261-8/+22
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* extend cache eventsRobin Appelman2020-11-261-3/+15
| | | | | | | | - adds cache remove event - expose storage id in event - emit events during cache move Signed-off-by: Robin Appelman <robin@icewind.nl>
* Empty string is returned as null, but empty string in file cache is the root ↵Joas Schilling2020-11-101-1/+5
| | | | | | and exists Signed-off-by: Joas Schilling <coding@schilljs.com>
* Don't leave cursors open when tests failJoas Schilling2020-11-091-12/+56
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Remove @suppress SqlInjectionCheckerMorris Jobke2020-09-161-3/+0
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Make Cache::removeChildren non recursiveRobin Appelman2020-08-201-15/+25
| | | | | | | | | | | | Currently the "add new files during scanning" call stack is smaller than the "remove deleted files during scanning" call stack. This can lead to the scanner adding folders in the folder tree that are to deep to be removed. This changes the `removeChildren` logic to be non recursive so there is no limit to the depth of the folder tree during removal Signed-off-by: Robin Appelman <robin@icewind.nl>
* Update license headers for 19Christoph Wurst2020-04-291-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add visibility to all methods and position of static keywordChristoph Wurst2020-04-101-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-101-2/+0
| | | | | | | | | | | | | | | 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-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* restart transaction when cache insert fails due to duplicateRobin Appelman2020-04-011-3/+7
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* reuse known parentId when inserting cache entries in scannerRobin Appelman2020-04-011-1/+3
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Fix search limit to homeRoeland Jago Douma2019-12-091-0/+4
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Update license headersChristoph Wurst2019-12-051-2/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Allow filtering the search results to the users home storageRobin Appelman2019-12-031-1/+4
| | | | | | | | | | | | | | | | | | | | This is done by adding a ```xml <d:eq> <d:prop> <oc:owner-id/> </d:prop> <d:literal>$userId</d:literal> </d:eq> ``` clause to the search query. Searching by `owner-id` can only be done with the current user id and the comparison can not be inside a `<d:not>` or `<d:or>` statement Signed-off-by: Robin Appelman <robin@icewind.nl>
* Some php-cs fixesRoeland Jago Douma2019-11-221-2/+2
| | | | | | | | | | | * Order the imports * No leading slash on imports * Empty line before namespace * One line per import * Empty after imports * Emmpty line at bottom of file Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* filter out empty filecache extension valuesRobin Appelman2019-11-131-1/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix folder deleteRobin Appelman2019-11-131-3/+9
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* dont create empty filecache extended rowsRobin Appelman2019-11-131-19/+33
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* store filecache extension fieldsRobin Appelman2019-11-131-21/+73
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* move more cache logic to querybuilderRobin Appelman2019-11-131-169/+181
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Properly return an int in the getId function of the cacheRoeland Jago Douma2019-08-071-1/+1
| | | | | | fixes #16684 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Remove deprecated searchByTagRoeland Jago Douma2019-07-261-46/+0
| | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* remove extra param in cache update callRobin Appelman2019-05-071-2/+2
| | | | | | param was leftover from earlier iterations of the "update event" Signed-off-by: Robin Appelman <robin@icewind.nl>
* Avoid calculating folder size for parent that needs scan.Ari Selseng2019-03-061-3/+27
| | | | Signed-off-by: Ari Selseng <ari@selseng.net>
* add event for cache updateRobin Appelman2019-02-181-1/+7
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* add event for inserting cache entriesRobin Appelman2019-02-071-9/+15
| | | | | | | | this provides a reliable way for apps to listen to new files without the need to of cache wrappers to hook into inserts themselves (something which isn't 100% reliable) Signed-off-by: Robin Appelman <robin@icewind.nl>