summaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Cache
Commit message (Collapse)AuthorAgeFilesLines
* dont update mimetype when moving to trashRobin Appelman2020-07-311-1/+5
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix renameFromStorage messing with folder mimetypeRobin Appelman2020-07-231-7/+10
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Update license headers for 19Christoph Wurst2020-04-292-0/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add method to storage backends to get directory content with metadataRobin Appelman2020-04-201-27/+10
| | | | | | | | | | | | | | | | | Currently you need to use `opendir` and then call `getMetadata` for every file, which adds overhead because most storage backends already get the metadata when doing the `opendir`. While storagebackends can (and do) use caching to relief this problem, this adds cache invalidation dificulties and only a limited number of items are generally cached (to prevent memory usage exploding when scanning large storages) With this new methods storage backends can use the child metadata they got from listing the folder to return metadata without having to keep seperate caches. Signed-off-by: Robin Appelman <robin@icewind.nl>
* Format code according to PSR2Christoph Wurst2020-04-101-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add visibility to all constantsChristoph Wurst2020-04-101-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add visibility to all methods and position of static keywordChristoph Wurst2020-04-102-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add visibility to all properties and move static keywordChristoph Wurst2020-04-101-2/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-107-9/+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-104-16/+16
| | | | 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>
* Use exactly one empty line after the namespace declarationChristoph Wurst2020-04-092-1/+1
| | | | | | For PSR2 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>
* call cache->insert directly instead of going trough cache->put first when ↵Robin Appelman2020-04-011-1/+1
| | | | | | scanning Signed-off-by: Robin Appelman <robin@icewind.nl>
* dont try to get existing cache data during scanning if we already know its a ↵Robin Appelman2020-04-011-4/+4
| | | | | | new file Signed-off-by: Robin Appelman <robin@icewind.nl>
* reuse known parentId when inserting cache entries in scannerRobin Appelman2020-04-012-1/+4
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Update the license headers for Nextcloud 19Christoph Wurst2020-03-318-0/+8
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the short array syntax, everywhereChristoph Wurst2020-03-267-30/+30
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use lowercase true, false and null constantsChristoph Wurst2020-03-251-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* dont try to update storage mtime if we can't get the mtimeRobin Appelman2020-03-021-6/+9
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Allow to overwrite the path on the cache eventJoas Schilling2020-02-131-0/+8
| | | | Signed-off-by: Joas Schilling <coding@schilljs.com>
* Update license headers for 18Christoph Wurst2019-12-201-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Merge pull request #18314 from nextcloud/fixFileIdSearchRoeland Jago Douma2019-12-101-0/+2
|\ | | | | Fix ambigious fileID on search
| * fix https://github.com/nextcloud/server/issues/18313tobiasKaminsky2019-12-101-0/+2
| | | | | | | | Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
* | 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-0519-23/+42
| | | | | | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* | Merge pull request #17941 from nextcloud/search-by-ownerRoeland Jago Douma2019-12-052-3/+10
|\ \ | |/ |/| Allow filtering the search results to the users home storage
| * remove old 'owner' filterRobin Appelman2019-12-031-5/+0
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
| * Allow filtering the search results to the users home storageRobin Appelman2019-12-032-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | dont set folder size to negative values during propagationRobin Appelman2019-11-261-2/+5
|/ | | | | | | | | | normally this shouldn't be a problem, but cache/storage desync might cause this so this adds some failsafe to ensure we dont corrupt the cache further the minimum value is set to -1 instead of 0 in order to triger a background scan on the folder and figure out the size properly Signed-off-by: Robin Appelman <robin@icewind.nl>
* Merge pull request #18079 from nextcloud/fixes/phpcsRoeland Jago Douma2019-11-253-4/+4
|\ | | | | Some php-cs fixes
| * Some php-cs fixesRoeland Jago Douma2019-11-223-4/+4
| | | | | | | | | | | | | | | | | | | | | | * 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>
* | Harden watcherRoeland Jago Douma2019-11-221-2/+2
|/ | | | Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* Fix cache movesRoeland Jago Douma2019-11-181-1/+4
| | | | 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-133-27/+110
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* move more cache logic to querybuilderRobin Appelman2019-11-132-169/+254
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Fix DAV mimetype searchRoeland Jago Douma2019-10-281-4/+7
| | | | | | | | | Fixes #15048 Catches the case where a full mimetype is sumbitted in the where like clause. Before we didn't catch this and it was just forwarded as is causing invalid queries. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* use OCP\EventDispatcher\Event over Symfony's deprecated EventArthur Schiwon2019-10-171-1/+1
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* use eq instead of in for loading single storageRobin Appelman2019-09-261-1/+9
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* log which storage id can't be insertedRobin Appelman2019-09-261-1/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* set a storage availability delay on auth issues to avoid lock outArthur Schiwon2019-08-221-2/+3
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* 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-264-74/+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-064-8/+32
| | | | Signed-off-by: Ari Selseng <ari@selseng.net>
* add event for cache updateRobin Appelman2019-02-182-1/+75
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* add event for inserting cache entriesRobin Appelman2019-02-072-10/+18
| | | | | | | | 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>