Commit graph

128 commits

Author SHA1 Message Date
Robin Appelman
5ab8439c00 fix: ensure nested mount points are handled in the correct order
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-03-21 18:01:26 +01:00
Côme Chilliet
342cb33f71 Apply suggestions from code review in View.php
Co-authored-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-09-05 17:06:11 +00:00
Côme Chilliet
ea2b28e1fc Lower log to debug for connections aborted by the client
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-09-05 17:06:11 +00:00
Côme Chilliet
b7d82f7c01 Detect aborted connection in OC\Files\View and stop writing data to the
output buffer

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-09-05 17:06:10 +00:00
Anna Larch
fe26271c78 fix: don't emit Hooks when hookpaths are empty
Signed-off-by: Anna Larch <anna@nextcloud.com>
2023-08-17 15:00:49 +02:00
Julius Härtl
4ca6c3af7a fix: Use proper path for quota fetching
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2023-03-07 07:21:20 +00:00
Robin Appelman
5bcf37b7ff only fetch the data for mounts inside a folder when needed
for most operations we don't actually care about any mounts inside a folder, only for metadata that needs to propagate across storage boundaries (size, etag, mtime) do we need all the submount info.

By only loading this data when needed we can save a bunch of storage setup in a number of cases

Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-02-09 11:39:00 +01:00
Côme Chilliet
028c225d96
Fix psalm errors
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-02-07 11:23:32 +01:00
Côme Chilliet
ff776a90b1
Strong type filesize related methods to ease 32bits problem findings
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-02-07 11:23:28 +01:00
Côme Chilliet
f5c361cf44
composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-20 11:45:08 +01:00
Louis Chemineau
66ba90ceff Update cache when file size === 0
The conditions were false when $result === 0.
$results here contains the number of written bits.
The correct way of checking for operation success is to check if $result === false

Signed-off-by: Louis Chemineau <louis@chmn.me>
2022-11-23 12:43:57 +01:00
Carl Schwan
a5ea677370 Rename file1 and file2 to source and target in Storage abstraction
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-10-18 17:21:47 +02:00
blizzz
ca958de7e9
Merge pull request #33566 from nextcloud/fopen-not-found-rescan
trigger a rescan when trying to fopen a file that exists in cache but not on disk
2022-10-01 21:47:26 +02:00
Carl Schwan
92a5a8f075 Cleanup tags and Share component
- Port to LoggerInterface
- Use IDBConnection and IQueryBuilder instead of raw SQL and OC_DB
- Use IEventListener instead of hooks
- Remove the now unused OC_DB and OC_DB_StatementWrapper legacy utils

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-09-29 15:15:28 +00:00
Robin Appelman
cb51564356 trigger a rescan when trying to fopen a file that exists in cache but not on disk
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-09-29 11:17:16 +02:00
Carl Schwan
51b9847fad
Merge branch 'master' into display-name-cache-public
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-08-15 15:28:30 +02: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 -04:00
Robin Appelman
6d6662ec68
expose displayname cache trough a public interface
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-05-18 03:47:34 +02:00
Côme Chilliet
069477e608
Migrate more classes of lib/private to LoggerInterface
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-04-26 16:52:52 +02:00
Vincent Petry
ff385dc679
Merge pull request #32082 from nextcloud/directory-content-lazy-owner
use a lazy user for the file owner when listing a directory
2022-04-25 11:44:44 +02:00
Robin Appelman
7a6c724a81 Use a lazy user for the file owner when listing a directory
Only getUID and getDisplayName are called on the file owner objects anyway
and we can get this information often without DB request

Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-22 17:02:37 +02:00
Robin Appelman
9f0ba3adc2
optimize adding submount info to directory content
no need to loop when we can do a hashtable lookup

Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-22 15:50:14 +02:00
Robin Appelman
5e69f98c16
sh
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-06 18:08:13 +02:00
Robin Appelman
151c800397
allow reusing known folder info when getting directory contents
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-04-06 14:40:34 +02:00
Côme Chilliet
140624d551
composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-04-05 16:47:13 +02:00
Côme Chilliet
d36a1a7bf6 Exit early if $storage is falsy in View::getDirectoryContent
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-04-05 13:58:49 +00:00
Côme Chilliet
916fbe81c6 Fix incorrect if conditions in View
($something->getPermissions() && Constants::PERMISSION_READ) does not
  make sense as PERMISSION_READ contant is 1 this will always evaluate to
  true.
getPersmissions is returning an int which is a bitwise combination as
  documented in the interface, so it should be used with bit operators.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-04-05 13:58:49 +00:00
Robin Appelman
ff666e648a Add dav plugin to trigger recalculating of checksums
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-31 07:44:13 +00:00
Robin Appelman
917c74e214
type fixes
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-04 16:30:16 +01:00
Robin Appelman
5c0fe93498
move teardown logic to SetupManager
Signed-off-by: Robin Appelman <robin@icewind.nl>
2022-03-04 16:29:50 +01:00
Vincent Petry
4903cb8db4
Merge pull request #29866 from nextcloud/isset-size
Check if size value is set
2022-01-17 10:59:52 +01:00
Carl Schwan
6312c0df69
Check style update
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-13 00:19:07 +01:00
Carl Schwan
aeecb72e96
Fix a few psalm issues and moved back to psalm/phar 4.18
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-12 20:03:06 +01:00
acsfer
97e1855ed5
Typo 2021-11-24 11:55:06 +01:00
acsfer
0a0fd33773
Check if size value is set
Using `isset()` as it does not return true for array keys that correspond to a `null` value, while `array_key_exists()` does.
Fix #29865
2021-11-23 21:33:28 +01:00
John Molakvoæ
d6152bf98d
Fix psalm
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2021-11-04 10:24:13 +01:00
John Molakvoæ
d6a26b2536
Revert "add dav plugin to trigger recalculating of checksums" 2021-11-01 11:26:17 +01:00
Robin Appelman
fd5e11a81a
Add dav plugin to trigger recalculating of checksums
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-08-23 15:38:58 +02:00
Morris Jobke
2ae60b42ab
Merge pull request #26494 from rigrig/fix-php8-deprecations
Fix some php 8 warnings
2021-06-07 23:30:59 +02:00
John Molakvoæ (skjnldsv)
215aef3cbd
Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +02:00
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>
2021-05-29 14:14:52 +02:00
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>
2021-05-21 15:00:34 +02:00
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>
2021-03-10 19:35:13 +01:00
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>
2021-02-26 11:29:01 +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
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>
2020-11-07 10:31:26 -05:00
Robin Appelman
cfde74442c
optimize View::getPath if we already know the storage id
Signed-off-by: Robin Appelman <robin@icewind.nl>
2020-09-16 13:49:07 +02:00
Christoph Wurst
cb057829f7
Update license headers for 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-29 11:57:22 +02:00
Scott Dutton
65e134c13a
Update View.php 2020-04-15 19:10:06 +01:00
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>
2020-04-12 13:01:29 +01:00