Commit Graph

63 Commits (feat/database/query-result-fetch-associative-fetch-num)

Author SHA1 Message Date
Robin Appelman 9ea03a9534 reuse dependencies from wrapped cache
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-08-18 11:14:52 +07:00
Robin Appelman 9f1d497a0b
Merge pull request #38261 from fsamapoor/replace_strpos_calls_in_lib_private
Refactors "strpos" calls in  lib/private to improve code readability.
2023-06-01 23:10:00 +07:00
Faraz Samapoor e7cc7653b8 Refactors "strpos" calls in lib/private to improve code readability.
Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
2023-05-15 15:17:19 +07:00
Côme Chilliet ae525e1935
Fix return types in phpdoc
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-05-15 12:24:42 +07:00
Robin Appelman 5267a74027
fix type hints
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-04 17:05:45 +07:00
Robin Appelman c9e4e30523 clear encrypted flag when moving away from encrypted storage
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-01 15:36:37 +07:00
Robin Appelman f76b4473ee
escape path prefix when doing cache jail search
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-11-02 12:44:51 +07:00
Carl Schwan 54031e370a Fix various other small psalm issues
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-10-17 12:40:35 +07:00
Robin Appelman b6f8b8da60 directly build the search filter for shared storage instead of setting up the source cache
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-08-17 11:58:57 +07:00
Robin Appelman 9d6c2ce301 optimize search post-processing for jail wrapper
don't both asking the wrapped cache if we know it's not in our jail anyway

Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-08-16 13:36:52 +07:00
Côme Chilliet 7ae6791737
Document all getIncomplete implementations as returning string|false
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-08-02 14:23:14 +07:00
Robin Appelman 118c647f61
properly handle cases where cache wrappers block access
`CacheWrapper::formatCacheEntry` can return false for files that should be filtered out

Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-11-01 11:48:01 +07:00
Vincent Petry e32d293346
Merge pull request #28476 from nextcloud/search-jail-insensitive
use case insensitive like when limiting search to jail
2021-08-24 08:59:35 +07:00
Robin Appelman c688703117
use getGetUnjailedRoot to determine if jailed search needs the path filter
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-08-23 16:27:53 +07:00
Robin Appelman c48f9ffcdd
use case insensitive like when limiting search to jail
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-08-17 13:51:45 +07:00
Robin Appelman 97aadbe46c
dont apply jail search filter is on the root
the extra '/' breaks things and the filter wouldn't do anything anyway except making the databases job harder

Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-07-26 17:44:52 +07:00
Robin Appelman 362cb2a11f
inject SearchBuilder
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-06-14 16:23:08 +07:00
Robin Appelman 5d1d53c42e
perform file search in a single query
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-06-14 16:11:29 +07:00
Robin Appelman 9774fb1573
use searchoperation for storage filter instead of db expression
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-06-14 16:11:25 +07:00
Robin Appelman e198dc1b20
rework search api to allow searching on multiple caches at once
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-06-14 16:11:22 +07:00
John Molakvoæ (skjnldsv) 215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +07:00
Robin Appelman 7ee528fc5a
properly use limit and offset for search in Jail wrapper
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-05-21 15:37:38 +07:00
Vincent Petry e559afb8d4
Merge pull request #25136 from nextcloud/cachejail-search-filter
do cachejail search filtering in sql
2021-03-15 17:45:30 +07:00
dependabot-preview[bot] eb502c02ff
Bump nextcloud/coding-standard from 0.3.0 to 0.5.0
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>
2021-02-18 13:31:24 +07:00
Robin Appelman e511a539b7
adjust tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-01-26 15:55:38 +07:00
Robin Appelman 5ae0be08b4
fix search in nested jails
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-01-26 15:30:54 +07:00
Robin Appelman 27f9df2e87
fix cachjail searching for root
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-01-26 15:30:50 +07:00
Robin Appelman a44aab11f7
do cachejail search filtering in sql
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-01-26 15:30:46 +07:00
Christoph Wurst d89a75be0b
Update all license headers for Nextcloud 21
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-12-16 18:48:22 +07:00
Christoph Wurst 2a054e6c04
Update the license headers for Nextcloud 20
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-08-24 14:54:25 +07:00
Morris Jobke fedf9c69d9
Use matching parameter names form interfaces and implementations
Found by Psalm 3.14.1

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-19 18:16:35 +07:00
Christoph Wurst 1584c9ae9c
Add visibility to all methods and position of static keyword
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 16:51:06 +07:00
Christoph Wurst caff1023ea
Format control structures, classes, methods and function
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>
2020-04-10 14:19:56 +07:00
Christoph Wurst 14c996d982
Use elseif instead of else if
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 10:35:09 +07:00
Christoph Wurst 41b5e5923a
Use exactly one empty line after the namespace declaration
For PSR2

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-09 11:48:10 +07:00
Christoph Wurst 1a9330cd69
Update the license headers for Nextcloud 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-31 14:52:54 +07:00
Christoph Wurst b80ebc9674
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-26 16:34:56 +07:00
Christoph Wurst 23eb0462e5
Use lowercase true, false and null constants
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-25 21:53:04 +07:00
Christoph Wurst 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +07:00
Roeland Jago Douma 68748d4f85
Some php-cs fixes
* 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>
2019-11-22 20:52:10 +07:00
Roeland Jago Douma 0487144b26
Remove deprecated searchByTag
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-07-26 12:29:19 +07:00
Ari Selseng d16cfb519e Avoid calculating folder size for parent that needs scan.
Signed-off-by: Ari Selseng <ari@selseng.net>
2019-03-06 15:23:37 +07:00
Roeland Jago Douma 0277cd7158
Properly search the root of a shared external storage
Fixes #1020

When an external storage is shared with you in full the root is ''
(empty). This adds an extra check for an empty jail basically.

Because if the jail is on the empty string. It matches all paths.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-11-05 16:27:43 +07:00
Robin Appelman 6c5ea0ceca
pass `Cache::getMoveInfo` along cache wrappers
fixes cross storage move in some cases

Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-10-17 14:57:33 +07:00
Roeland Jago Douma c1ff12e234
CacheJail should apply limit and offset after searching
Else the results might not be correct.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-02-07 13:41:15 +07:00
Roeland Jago Douma 53a780e31c
Do not try to get the jailed path if we can't find the id
Fixes #8047

If we can't find the file by id there we should just return null instead
of trying to get the jailed path of null.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-02-03 14:45:28 +07:00
Robin Appelman c87d689253
delay calculating the shared cache root until it's used
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-12-04 15:16:39 +07:00
Morris Jobke 0eebff152a
Update license headers
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-06 16:56:19 +07:00
Robin Appelman dfe662ad42
Fix propagating changes within jail wrapper
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-07-11 17:55:04 +07:00
Robin Appelman fa81759917
fix moving folders out of a cache jail
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-06-15 13:59:06 +07:00