Commit Graph

95 Commits (6312c0df6949955d1cd59c3dd444268e0773293c)

Author SHA1 Message Date
Carl Schwan 6312c0df69
Check style update
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2 years ago
Carl Schwan aeecb72e96
Fix a few psalm issues and moved back to psalm/phar 4.18
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2 years ago
John Molakvoæ d6152bf98d
Fix psalm
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
3 years ago
John Molakvoæ d6a26b2536
Revert "add dav plugin to trigger recalculating of checksums" 3 years ago
Robin Appelman fd5e11a81a
Add dav plugin to trigger recalculating of checksums
Signed-off-by: Robin Appelman <robin@icewind.nl>
3 years ago
Morris Jobke 2ae60b42ab
Merge pull request #26494 from rigrig/fix-php8-deprecations
Fix some php 8 warnings
3 years ago
John Molakvoæ (skjnldsv) 215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
3 years ago
Richard de Boer 7990f95558 Check whether output buffering is active before turning it off
Before we just turned it off and @suppressed the error if ob was not active.
In PHP 8 this error is no longer suppressed, so try to not cause it at all.

Signed-off-by: Richard de Boer <git@tubul.net>
3 years ago
Christoph Wurst 8196420063
Drop \OCP\User
Inlines and remaining usages and drops the deprecated public API.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
3 years ago
Robin Appelman f98fed3f8a
reuse usermanager instance when processing search results
saves some time when processing large search results

Signed-off-by: Robin Appelman <robin@icewind.nl>
3 years ago
Julius Härtl 19eb48b8a3
Properly end iterating over the file once the target has been reached
Signed-off-by: Julius Härtl <jus@bitgrid.net>
3 years ago
Christoph Wurst d89a75be0b
Update all license headers for Nextcloud 21
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Ashod Nakashian a66fb45c0b Unlock when promoting to exclusive lock fails
In certain cases changeLock to EXCLUSIVE fails
and throws LockedException. This leaves the
file locked as SHARED in file_put_contents,
which prevents retrying (because on second
call file_put_contents takes another SHARED
lock on the same file, and changeLock doesn't
allow more than a single SHARED lock to promote
to EXCLUSIVE).

To avoid this case, we catch the LockedException
and unlock before re-throwing.

Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
4 years ago
Robin Appelman cfde74442c
optimize View::getPath if we already know the storage id
Signed-off-by: Robin Appelman <robin@icewind.nl>
4 years ago
Christoph Wurst cb057829f7
Update license headers for 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Scott Dutton 65e134c13a
Update View.php 4 years ago
Scott Dutton 75b99e85ff
Increase max read
8kb is very low, especially given this will be local files

Signed-off-by: Scott Dutton <scott@exussum.co.uk>
4 years ago
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>
4 years ago
Christoph Wurst 14c996d982
Use elseif instead of else if
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst 42625a46be
Remove spaces after method or function call
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst afbd9c4e6e
Unify function spacing to PSR2 recommendation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst 1a9330cd69
Update the license headers for Nextcloud 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Christoph Wurst b80ebc9674
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 years ago
Roeland Jago Douma 3443a00621
Actually check if the owner is not null
Else this can error out on storages that do not have an owner (e.g.
groupfolders).

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
4 years ago
Robin Appelman fab22ac14c
pass the existing locks info when making locked exception with absolute paths
Signed-off-by: Robin Appelman <robin@icewind.nl>
4 years ago
Joas Schilling 08cadf8416
Don't create invalid users
Signed-off-by: Joas Schilling <coding@schilljs.com>
4 years ago
Christoph Wurst 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
5 years ago
Julius Härtl 9eb1554fad
Properly anotate LockedException in files node api
Signed-off-by: Julius Härtl <jus@bitgrid.net>
5 years ago
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>
5 years ago
Roeland Jago Douma 2f5810f26e
Merge pull request #15832 from nextcloud/bugfix/noid/fulltext-search-groupfolders
Fix full text search for groupfolders
5 years ago
Morris Jobke 9dac9710e4 Fix full text search for groupfolders
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
5 years ago
Robin Appelman b4e2d8f8ad
handle storage exceptions when trying to set mtime
not all storage backends can handle setting the mtime and they might
not always handle that error correctly.

Signed-off-by: Robin Appelman <robin@icewind.nl>
5 years ago
Robin Appelman 98dd526010
search files by id in shared storages last
this prevents unneeded recursion when the file is not in the share

Signed-off-by: Robin Appelman <robin@icewind.nl>
5 years ago
Robin Appelman cc29f5d719
always allow moving mountpoints inside the same mountpoint
even if that mountpoint isn't normally a valid target for moving mounts into

Signed-off-by: Robin Appelman <robin@icewind.nl>
5 years ago
Joas Schilling 17d5e47937
Remove spaming debug logs
Signed-off-by: Joas Schilling <coding@schilljs.com>
5 years ago
Julius Härtl c778032276
Properly handle null as ownerId if file system access is denied by access token
Signed-off-by: Julius Härtl <jus@bitgrid.net>
5 years ago
Joas Schilling 01b4db62fb
Add dispatcher events to User and Group objects
Signed-off-by: Joas Schilling <coding@schilljs.com>
5 years ago
Robin Appelman f69c2d1e84
cleanup shared lock if changing to exclusive lock failed
Signed-off-by: Robin Appelman <robin@icewind.nl>
5 years ago
Roeland Jago Douma 2c6d36105c
Emit write update only once on touch
When a touch is done (i.e. when creating a new file in the node API)
The hooks contain 'write' and 'touch' (and the operation is touch as
well). This would cause a double write update. Which doesn't make sense.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
6 years ago
Robin Appelman 4c0cbdff36
tokens can't be valid local user names
this saves searching for shares on non-public link dav requests

Signed-off-by: Robin Appelman <robin@icewind.nl>
6 years ago
Julius Härtl 73cf71a20f
Add resource type phpDoc for putContent methods
Signed-off-by: Julius Härtl <jus@bitgrid.net>
6 years ago
Robin Appelman e3de7ec867
Debug log file not found when getting fileinfo
Signed-off-by: Robin Appelman <robin@icewind.nl>
6 years ago
Morris Jobke fb296342b9
Merge pull request #9387 from nextcloud/getcachentry-lock
remove unneeded locks in getCacheEntry
6 years ago
Robin Appelman 734aec1522
remove unneeded locks in getCacheEntry
Signed-off-by: Robin Appelman <robin@icewind.nl>
6 years ago
Robin Appelman d71783fb93
Log mount and storage issues in getFileInfo
Signed-off-by: Robin Appelman <robin@icewind.nl>
6 years ago
Arthur Schiwon 38a90130ce
move log constants to ILogger
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
6 years ago
Morris Jobke a661f043e1
Remove unneeded semicolon and parentheses
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
6 years ago
Morris Jobke 4c38d1ed01
Merge pull request #8054 from nextcloud/substr-use-index
Use index based string access for substr with length of 1
6 years ago
Morris Jobke 9ff51aafc5
Use index based string access for substr with length of 1
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
6 years ago
Morris Jobke 0a56d2185e
Return value immediately instead of assigning to a one-time variable
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
6 years ago