summaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Cache/Cache.php
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* return the correct value when trying to get a non existing item from cache by idRobin Appelman2018-11-161-0/+2
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Fix UniqueConstraintViolationException while insert into oc_filecacheMorris Jobke2018-11-121-7/+18
| | | | | | | | * fixes #6160 by not being prone to the race condition in insertIfNotExists * fixes #12228 by not using a query that can result in a deadlock * replaces the insertIfNotExists call with an insert which is wrapped into a try-catch block Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Remove unneeded semicolon and parenthesesMorris Jobke2018-01-261-1/+1
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Use proper code flow instead of not needed else branchMorris Jobke2018-01-251-2/+1
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Use basename() instead of self implementationMorris Jobke2017-11-231-2/+2
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Update license headersMorris Jobke2017-11-061-2/+2
| | | | Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* Merge pull request #5812 from MrJeos/masterMorris Jobke2017-07-221-1/+1
|\ | | | | Fix for mb strlen
| * Fix for mb strlenArtem Kochnev2017-07-201-1/+1
| | | | | | Error with moving files with long names in UTF-8
* | Also repair storage id's when repairing invalid entriesRobin Appelman2017-07-211-1/+1
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | Add Phan plugin to check for SQL injectionsLukas Reschke2017-07-201-0/+1
|/ | | | | | | | | | This adds a phan plugin which checks for SQL injections on code using our QueryBuilder, while it isn't perfect it should already catch most potential issues. As always, static analysis will sometimes have false positives and this is also here the case. So in some cases the analyzer just doesn't know if something is potential user input or not, thus I had to add some `@suppress SqlInjectionChecker` in front of those potential injections. The Phan plugin hasn't the most awesome code but it works and I also added a file with test cases. Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* rename fun to funcRobin Appelman2017-03-301-1/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Add tests for query builder (i)likeRobin Appelman2017-03-301-1/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Move all children of a folder in a single queryRobin Appelman2017-03-301-18/+27
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Merge pull request #4004 from nextcloud/backport-27172Roeland Jago Douma2017-03-281-0/+8
|\ | | | | Remove SharedCache::getNumericStorageId to let CacheWrapper do it
| * Remove SharedCache::getNumericStorageId to let CacheWrapper do itVincent Petry2017-03-231-0/+8
| | | | | | | | | | | | The CacheWrapper will properly forward the call to the wrapped cache. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
* | Merge pull request #3850 from nextcloud/search-orderMorris Jobke2017-03-231-0/+2
|\ \ | |/ |/| Fix search ordering
| * Fix search orderingRobin Appelman2017-03-231-0/+2
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | [OC/Files/Cache]: Fix wrong usage of basenameXuanwo2017-03-141-1/+2
|/ | | | | | Fix https://github.com/nextcloud/server/issues/3837 Signed-off-by: Xuanwo <xuanwo@yunify.com>
* dont allow empty wildcard searchRobin Appelman2017-03-131-0/+4
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Allow searching for favoritesRobin Appelman2017-03-081-4/+17
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Implement webdav SEARCHRobin Appelman2017-03-011-7/+36
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Refactor files' CacheEntry object creation to call cacheEntryFromData() all ↵Frédéric Fortier2017-02-221-36/+16
| | | | | | the time thus allowing proper casts to be done Signed-off-by: Frédéric Fortier <frederic.fortier@oronospolytechnique.com>
* Typecast filecache 'storage' as int to return it as documented, fixes #3461Frédéric Fortier2017-02-201-0/+2
| | | | Signed-off-by: Frédéric Fortier <frederic.fortier@oronospolytechnique.com>
* always use numeric storage id in cacheentryRobin Appelman2016-12-131-4/+2
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* fix cacheentry return wrong storage idRobin Appelman2016-12-131-0/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* let the share backend get the node cacheentry to save queriesRobin Appelman2016-11-171-16/+28
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Update with robinJoas Schilling2016-07-211-1/+1
|
* Fix othersJoas Schilling2016-07-211-3/+4
|