Hamid Dehnavi
ea06cf2f39
Convert isset ternary to null coalescing operator
...
Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
2023-09-28 17:44:19 +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
Robin Appelman
f5e2b0b22f
allow storing multiple mounts for the same rootid in the mount cache
...
currently `[$userId, $rootId]` is used as the unique key for storing mounts in the mount cache,
however there are cases where the same rootid is mounted in multiple places for a user which currently leads to not all of those mounts being added to the cache.
Previously this didn't matter as the mount cache was only used to list users with access to a specific file, so a user having access to the file multiple times didn' change anything.
With 24 the mount cache is used for more cases and multiple mounts for the same id becomes relevant.
While I think there isn't a real negative effect atm besides missing the optimized path we should ensure that the mounts are properly listed
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-04-28 15:08:08 +07:00
Joas Schilling
6b0cef6b9a
Add transaction around mass mounts operations
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-03-07 19:58:55 +07:00
Robin Appelman
91d5f6a826
more filesystem setup performance instrumentation
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-02-10 11:11:13 +07:00
Robin Appelman
10767d7779
fix updating cached mounts that didn't have their mount provider set previously
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-08-16 13:47:41 +07:00
luz paz
368f83095d
Fix typos in lib/private subdirectory
...
Found via `codespell -q 3 -S l10n -L jus ./lib/private`
Signed-off-by: luz paz <luzpaz@github.com>
2022-07-27 08:52:17 +07:00
Carl Schwan
d5c23dbb9f
Move CappedMemoryCache to OCP
...
This is an helpful helper that should be used in more place than just
server and this is already the case with groupfodlers, deck, user_oidc
and more using it, so let's make it public
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-07-14 15:54:31 +07:00
Carl Schwan
ec6b83cc18
Add stricter psalm type for CappedMemoryCache
...
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-05-12 15:06:18 +07:00
Carl Schwan
dbdb9f6f11
Merge pull request #32034 from nextcloud/bugfix/noid/satisfy-binary-operation-order
...
Make the binary operation order explicit
2022-04-27 11:53:18 +07:00
Robin Appelman
561a2071e4
only register mounts that are new from providers that are new during a full setup
...
this fixes cases where during the (partial) setup of a shared mount a full setup is triggered
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-21 12:53:50 +07:00
Joas Schilling
49e62149d8
Make the binary operation order explicit
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-04-21 10:47:26 +07:00
Robin Appelman
99ac46d8f5
allow getting mounts by providers
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-04 14:57:56 +07:00
Côme Chilliet
765999f454
Merge pull request #31609 from nextcloud/fix/migrate-away-from-ilogger
...
Migrate from ILogger to LoggerInterface in lib/private
2022-03-29 09:39:38 +07:00
Vincent Petry
1bc86a95c4
Make phpcs happy in MountProviderCollection
...
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2022-03-24 20:26:42 +07:00
Robin Appelman
881e107543
Apply suggestions from code review
...
Co-authored-by: Louis <6653109+artonge@users.noreply.github.com>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:41:37 +07:00
Robin Appelman
1179873f33
add comment for getMountForPath loop
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:36:59 +07:00
Robin Appelman
63ad99ba4a
fix method name
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:04:01 +07:00
Robin Appelman
d342c764f2
don't double setup provider when calling `setupForUser` after `setupForPath`
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:03:13 +07:00
Robin Appelman
506d29c095
update cached mounts when only specific providers have been setup
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:01:55 +07:00
Robin Appelman
469a684d45
allow getting mounts by provider
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:01:38 +07:00
Robin Appelman
04052a9594
allow getting cached mounts by path from the mount cache
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-24 17:01:12 +07:00
Côme Chilliet
6be7aa112f
Migrate from ILogger to LoggerInterface in lib/private
...
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 16:21:25 +07:00
Robin Appelman
07a7dcb824
move user mountpoint setup to setupmanager
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-04 16:30:12 +07:00
Robin Appelman
5c0fe93498
move teardown logic to SetupManager
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-04 16:29:50 +07:00
Robin Appelman
7630d7a934
more type hints for ICachedMountInfo and IMountManager
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-04 16:28:11 +07:00
Robin Appelman
cfb7923e08
store mountprovider for each mount in the mounts table
...
this enabled more fine grained filesystem setup
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-02-23 18:02:33 +07:00
Morris Jobke
2ae60b42ab
Merge pull request #26494 from rigrig/fix-php8-deprecations
...
Fix some php 8 warnings
2021-06-07 23:30:59 +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
Richard de Boer
f23d057ad9
Fix functions taking optional parameters before required ones
...
PHP 8 shows deprecation warnings about this, see #25806
Removes the "default" values, as they actually are required parameters anyway.
Signed-off-by: Richard de Boer <git@tubul.net>
2021-05-29 14:14:52 +07:00
Julius Härtl
1e2cf820c8
Filter mounts for file id before trying to get user information
...
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2021-04-30 07:55:38 +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
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
Joas Schilling
8027dcbc6f
Don't leave cursors open when tests fail
...
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-11-09 12:28:17 +07:00
Morris Jobke
99c9423766
Remove @suppress SqlInjectionChecker
...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-09-16 15:53:56 +07:00
Christoph Wurst
1f7f93a695
Update license headers for Nextcloud 20 (again)
...
There are still lots of outdated headers, so time for another round of
updates.
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-09-07 14:37:44 +07:00
Julius Härtl
ac2999a26a
Transfer shares of the transferred root node
...
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-08-31 14:23:34 +07:00
Morris Jobke
e47cfc9a54
Properly add new methods to interface and document in PHPDoc for getRootMounts()
...
Introduced in #22063 and was just forgotten.
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-17 17:13:46 +07:00
Morris Jobke
438ac23e2a
Distribute preview folders in appdata in multibucket setup to multiple buckets
...
* introduces a new IRootMountProvider to register mount points inside the root storage
* adds a AppdataPreviewObjectStoreStorage to handle the split between preview folders and bucket number
Ref #22033
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2020-08-06 22:19:20 +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
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
Robin Appelman
c300516e51
more efficient way to detect added and removed mounts
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-08-16 19:56:49 +07:00
Robin Appelman
95981810c0
remove double loop for detecting changed mounts
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-08-16 18:24:56 +07:00
Morris Jobke
19c49c8473
Use the path_hash instead of the path to query the filecache
...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-07-16 16:10:34 +07:00
Robin Appelman
3ad6084891
Add the option to filter mounts for a user
...
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-07-10 16:49:26 +07:00
Morris Jobke
d3d045dd5c
Remove unused import statements
...
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-02-14 16:55:43 +07:00
Lukas Reschke
989a8a3668
Merge pull request #6220 from nextcloud/cached-mount-info-filepath
...
Allow getting the filepath when getting cached mounts by fileid
2017-11-09 00:04:25 +07:00