Commit Graph

46 Commits

Author SHA1 Message Date
Robin Appelman 8a92229485
getStorage can also return null
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-24 14:56:40 +01: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 +01:00
Roeland Jago Douma 6895d97cf0
Merge pull request #22520 from nextcloud/normalize-path-invalid-utf8
dont use `false` as cache key for non utf8 path in normalizePath
2020-09-09 21:52:36 +02: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 +02:00
Robin Appelman a792a51dca
dont use `false` as cache key for non utf8 path in normalizePath
since `json_encode` returns `false` if it's input isn't utf8, all non utf8 paths passed to normalizePath will currently return the same cached result.

Fixing this makes working with non utf8 storages a *little* bit more possible for apps

Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-08-31 17:29:36 +02:00
korelstar d8a80cd45c
fix: file quota was not applied in all cases 2020-08-20 16:11:50 +02:00
Robin Appelman 70906a359f
ensure home storage is initialized on first setup
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-07-09 11:14:45 +02:00
Christoph Wurst 28f8eb5dba
Add visibility to all constants
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 16:54:27 +02: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 +02:00
Christoph Wurst a7c8d26d31
Add visibility to all properties and move static keyword
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 16:48:31 +02: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 +02:00
Joas Schilling f8a5812f98
Try to use the display name of file transfers
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-04-08 15:41:20 +02:00
Christoph Wurst 463b388589
Merge pull request #20170 from nextcloud/techdebt/remove-unused-imports
Remove unused imports
2020-03-27 17:14:08 +01: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 +01:00
Christoph Wurst 74936c49ea
Remove unused imports
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-25 22:08:08 +01:00
Christoph Wurst 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +01:00
Christoph Wurst 1b85ef4bf2
Fix string doc type casing
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2018-11-15 11:57:05 +01:00
Robin Appelman 565d830c11
expose storagefactory in server container
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-10-17 14:57:30 +02:00
Roeland Jago Douma d5bf2c4523
Move normalizePath to regexes instead of looping
This is IMO a bit more readable and it seems to make the code faster.
Tested it on the company instance where there are over 3k calls to this
function. It shaves off around 10ms.

The advantage here is that the pattern gets optimized by php itsel and
cached.
Also looking for all patterns at the same time and especially no longer
looping for /./ patterns should save time.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-10-10 13:23:59 +02:00
Arthur Schiwon 38a90130ce
move log constants to ILogger
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2018-04-26 10:45:52 +02:00
Roeland Jago Douma 6868da9958
Make normalized cache path larger
On larger instances with a large number of shares this can make a real
impact as the default 512 entries are easily filled.

Making this contain max 2048 entries has basically no effect on smaller
installations (as they probably never hit the 512 now). But makes sure
we don't evict entries in the larger case.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-04-04 12:44:52 +02:00
Morris Jobke 9ff51aafc5
Use index based string access for substr with length of 1
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-26 13:38:34 +01:00
Lukas Reschke 030d85bc9c
Remove unused functions
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2017-07-19 10:28:12 +02:00
Morris Jobke c54a59d51e
Remove unused use statements
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-04-22 19:23:31 -05:00
Robin Appelman 714f198a5d
mount shared mounts last
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-03-22 17:15:42 +01:00
Morris Jobke 54ca411ff0 Merge pull request #2167 from nextcloud/mountmanager-lockdown
ensure we setup the mount manager when in lockdown
2016-11-17 16:56:55 +01:00
Morris Jobke b373f52fa8
only use one kind of hack for the storage wrappers of the sharing code
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2016-11-16 19:04:47 +01:00
Vincent Petry e7b1196dd6
Hack to prevent warning for read-only wrapper in public links
Storage wrappers should normally always be registered inside a presetup
hook. However in the public link scenario this is not possible and
there is currently no good alternative with the current architecture.

Instead of logging a warning every time, this fix prevents the warning
to be shown but also adds a FIXME in the code for the future. This is
ok because this app is already using private/internal APIs at the
moment and should be reworked properly in the future.
2016-11-16 19:04:42 +01:00
Robin Appelman a7c0d99705
ensure we setup the mount manager when in lockdown
Signed-off-by: Robin Appelman <robin@icewind.nl>
2016-11-16 17:24:37 +01:00
Robin Appelman b56f2c9ed0
basic lockdown logic
Signed-off-by: Robin Appelman <icewind@owncloud.com>
2016-11-16 15:24:23 +01:00
Vincent Petry 237dab675e
Fix initMountPoints to set usersSetup earlier
This is needed because in some cases like LDAP, the user manager itself
might trigger avatar updates which would internally also call
initMountPoints with the same user. This could cause the same user to
be setup twice, and in some sharing situations could cause recursive
deduplication of shares by adding "(2)" every time.
2016-11-03 20:45:40 +01:00
Vincent Petry f737426eca
Add using casing check/fix for initMountPoints 2016-11-02 22:21:46 +01:00
Morris Jobke 4d2835802f
hide storage wrapper warning for the readonly storage
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2016-10-13 14:37:31 +02:00
Joas Schilling 0215b004da
Update with robin 2016-07-21 18:13:58 +02:00
Joas Schilling ba87db3fcc
Fix others 2016-07-21 18:13:57 +02:00
Vincent Petry 5ad8fa7675
Add keepUnicode value in the cache key of normalizedPathCache 2016-06-01 14:28:59 +02:00
Lukas Reschke aba539703c
Update license headers 2016-05-26 19:57:24 +02:00
Robin Appelman de5b7609f9 use mount providers to setup home storages (#24567) 2016-05-17 21:40:55 +02:00
Morris Jobke 6b12f96b14 Merge pull request #24341 from owncloud/scan-nfd-showwarning
Add files:scan warning when NFD or incompatible encoding found
2016-05-02 09:41:12 +02:00
Roeland Douma 8f8ae963fd Merge pull request #24207 from owncloud/cache-mount-provider
mount custom cache folder using mount providers
2016-04-30 10:47:35 +02:00
Thomas Müller 6c2e94e0b2 Merge pull request #24335 from owncloud/warning-for-wrongly-done-storage-wrappers
Add a warning if a storage wrapper was registered outside of the hook
2016-04-29 17:43:50 +02:00
Robin Appelman e51467689d
mount custom cache folder using mount providers 2016-04-29 17:41:09 +02:00
Vincent Petry 4326d73ff6
Fix SMB storage to not normalize UTF8
This makes sure that even if a NFD file name exists, it is found by the
storage and will be visible to higher layers. Even though the file will
be discarded anyway there, it gives the scanner a chance to display a
warning at least.
2016-04-29 16:19:53 +02:00
Robin Appelman d850a764eb cap the normalized path cache 2016-04-29 13:17:41 +02:00
Joas Schilling f1b6b0799c
Add a warning if a storage wrapper was registered outside of the hook 2016-04-29 09:08:40 +02:00
Roeland Jago Douma dedf392751
Move \OC\Files to PSR-4 2016-04-24 21:37:35 +02:00