Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/dav/composer/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
class ComposerStaticInitDAV
{
public static $prefixLengthsPsr4 = array (
'O' =>
'O' =>
array (
'OCA\\DAV\\' => 8,
),
);

public static $prefixDirsPsr4 = array (
'OCA\\DAV\\' =>
'OCA\\DAV\\' =>
array (
0 => __DIR__ . '/..' . '/../lib',
),
Expand Down
3 changes: 2 additions & 1 deletion apps/files_external/lib/Config/ExternalMountPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
use OC\Files\Mount\MountPoint;
use OCA\Files_External\Lib\Auth\Password\SessionCredentials;
use OCA\Files_External\Lib\StorageConfig;
use OCP\Files\Mount\IExternalMountPoint;

class ExternalMountPoint extends MountPoint {
class ExternalMountPoint extends MountPoint implements IExternalMountPoint {

public function __construct(
protected StorageConfig $storageConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
'OCA\\Files_Sharing\\External\\Watcher' => $baseDir . '/../lib/External/Watcher.php',
'OCA\\Files_Sharing\\Helper' => $baseDir . '/../lib/Helper.php',
'OCA\\Files_Sharing\\Hooks' => $baseDir . '/../lib/Hooks.php',
'OCA\\Files_Sharing\\ISharedMountPoint' => $baseDir . '/../lib/ISharedMountPoint.php',
'OCA\\Files_Sharing\\ISharedStorage' => $baseDir . '/../lib/ISharedStorage.php',
'OCA\\Files_Sharing\\Listener\\BeforeDirectFileDownloadListener' => $baseDir . '/../lib/Listener/BeforeDirectFileDownloadListener.php',
'OCA\\Files_Sharing\\Listener\\BeforeNodeReadListener' => $baseDir . '/../lib/Listener/BeforeNodeReadListener.php',
Expand Down
1 change: 0 additions & 1 deletion apps/files_sharing/composer/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ class ComposerStaticInitFiles_Sharing
'OCA\\Files_Sharing\\External\\Watcher' => __DIR__ . '/..' . '/../lib/External/Watcher.php',
'OCA\\Files_Sharing\\Helper' => __DIR__ . '/..' . '/../lib/Helper.php',
'OCA\\Files_Sharing\\Hooks' => __DIR__ . '/..' . '/../lib/Hooks.php',
'OCA\\Files_Sharing\\ISharedMountPoint' => __DIR__ . '/..' . '/../lib/ISharedMountPoint.php',
'OCA\\Files_Sharing\\ISharedStorage' => __DIR__ . '/..' . '/../lib/ISharedStorage.php',
'OCA\\Files_Sharing\\Listener\\BeforeDirectFileDownloadListener' => __DIR__ . '/..' . '/../lib/Listener/BeforeDirectFileDownloadListener.php',
'OCA\\Files_Sharing\\Listener\\BeforeNodeReadListener' => __DIR__ . '/..' . '/../lib/Listener/BeforeNodeReadListener.php',
Expand Down
5 changes: 3 additions & 2 deletions apps/files_sharing/lib/External/Mount.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
use OC\Files\Mount\MountPoint;
use OC\Files\Storage\Storage;
use OC\Files\Storage\StorageFactory;
use OCA\Files_Sharing\ISharedMountPoint;
use OCP\Files\Mount\IExternalMountPoint;
use OCP\Files\Mount\IMovableMount;
use OCP\Files\Mount\ISharedMountPoint;
use Override;

class Mount extends MountPoint implements IMovableMount, ISharedMountPoint {
class Mount extends MountPoint implements IMovableMount, ISharedMountPoint, IExternalMountPoint {
public function __construct(
string|Storage $storage,
string $mountpoint,
Expand Down
1 change: 1 addition & 0 deletions apps/files_sharing/lib/SharedMount.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\Events\InvalidateMountCacheEvent;
use OCP\Files\Mount\IMovableMount;
use OCP\Files\Mount\ISharedMountPoint;
use OCP\Files\Storage\IStorageFactory;
use OCP\IDBConnection;
use OCP\IUser;
Expand Down
1 change: 1 addition & 0 deletions build/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
</DeprecatedConstant>
<DeprecatedMethod>
<code><![CDATA[getEvent]]></code>
<code><![CDATA[getEvent]]></code>
</DeprecatedMethod>
</file>
<file src="apps/comments/lib/MaxAutoCompleteResultsInitialState.php">
Expand Down
2 changes: 2 additions & 0 deletions lib/composer/composer/LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

Copyright (c) Nils Adermann, Jordi Boggiano

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -17,3 +18,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

2 changes: 2 additions & 0 deletions lib/composer/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -495,10 +495,12 @@
'OCP\\Files\\Lock\\LockContext' => $baseDir . '/lib/public/Files/Lock/LockContext.php',
'OCP\\Files\\Lock\\NoLockProviderException' => $baseDir . '/lib/public/Files/Lock/NoLockProviderException.php',
'OCP\\Files\\Lock\\OwnerLockedException' => $baseDir . '/lib/public/Files/Lock/OwnerLockedException.php',
'OCP\\Files\\Mount\\IExternalMountPoint' => $baseDir . '/lib/public/Files/Mount/IExternalMountPoint.php',
'OCP\\Files\\Mount\\IMountManager' => $baseDir . '/lib/public/Files/Mount/IMountManager.php',
'OCP\\Files\\Mount\\IMountPoint' => $baseDir . '/lib/public/Files/Mount/IMountPoint.php',
'OCP\\Files\\Mount\\IMovableMount' => $baseDir . '/lib/public/Files/Mount/IMovableMount.php',
'OCP\\Files\\Mount\\IShareOwnerlessMount' => $baseDir . '/lib/public/Files/Mount/IShareOwnerlessMount.php',
'OCP\\Files\\Mount\\ISharedMountPoint' => $baseDir . '/lib/public/Files/Mount/ISharedMountPoint.php',
'OCP\\Files\\Mount\\ISystemMountPoint' => $baseDir . '/lib/public/Files/Mount/ISystemMountPoint.php',
'OCP\\Files\\Node' => $baseDir . '/lib/public/Files/Node.php',
'OCP\\Files\\NotEnoughSpaceException' => $baseDir . '/lib/public/Files/NotEnoughSpaceException.php',
Expand Down
2 changes: 2 additions & 0 deletions lib/composer/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -536,10 +536,12 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
'OCP\\Files\\Lock\\LockContext' => __DIR__ . '/../../..' . '/lib/public/Files/Lock/LockContext.php',
'OCP\\Files\\Lock\\NoLockProviderException' => __DIR__ . '/../../..' . '/lib/public/Files/Lock/NoLockProviderException.php',
'OCP\\Files\\Lock\\OwnerLockedException' => __DIR__ . '/../../..' . '/lib/public/Files/Lock/OwnerLockedException.php',
'OCP\\Files\\Mount\\IExternalMountPoint' => __DIR__ . '/../../..' . '/lib/public/Files/Mount/IExternalMountPoint.php',
'OCP\\Files\\Mount\\IMountManager' => __DIR__ . '/../../..' . '/lib/public/Files/Mount/IMountManager.php',
'OCP\\Files\\Mount\\IMountPoint' => __DIR__ . '/../../..' . '/lib/public/Files/Mount/IMountPoint.php',
'OCP\\Files\\Mount\\IMovableMount' => __DIR__ . '/../../..' . '/lib/public/Files/Mount/IMovableMount.php',
'OCP\\Files\\Mount\\IShareOwnerlessMount' => __DIR__ . '/../../..' . '/lib/public/Files/Mount/IShareOwnerlessMount.php',
'OCP\\Files\\Mount\\ISharedMountPoint' => __DIR__ . '/../../..' . '/lib/public/Files/Mount/ISharedMountPoint.php',
'OCP\\Files\\Mount\\ISystemMountPoint' => __DIR__ . '/../../..' . '/lib/public/Files/Mount/ISystemMountPoint.php',
'OCP\\Files\\Node' => __DIR__ . '/../../..' . '/lib/public/Files/Node.php',
'OCP\\Files\\NotEnoughSpaceException' => __DIR__ . '/../../..' . '/lib/public/Files/NotEnoughSpaceException.php',
Expand Down
9 changes: 2 additions & 7 deletions lib/private/Files/FileInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

use OC\Files\Cache\CacheEntry;
use OC\Files\Mount\HomeMountPoint;
use OCA\Files_Sharing\ISharedMountPoint;
use OCP\Constants;
use OCP\Files\Cache\ICacheEntry;
use OCP\Files\Mount\IMountPoint;
use OCP\Files\Mount\ISharedMountPoint;
use OCP\IUser;

/**
Expand Down Expand Up @@ -285,13 +285,8 @@ public function isShareable() {
return $this->checkPermissions(Constants::PERMISSION_SHARE);
}

/**
* Check if a file or folder is shared
*
* @return bool
*/
#[\Override]
public function isShared() {
public function isShared(): bool {
return $this->mount instanceof ISharedMountPoint;
}

Expand Down
10 changes: 4 additions & 6 deletions lib/private/Files/SetupManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
use OC\ServerNotAvailableException;
use OC\Share20\ShareDisableChecker;
use OC_Hook;
use OCA\Files_External\Config\ExternalMountPoint;
use OCA\Files_Sharing\External\Mount;
use OCA\Files_Sharing\ISharedMountPoint;
use OCA\Files_Sharing\SharedMount;
use OCP\App\IAppManager;
use OCP\Constants;
use OCP\Diagnostics\IEventLogger;
Expand All @@ -44,8 +40,10 @@
use OCP\Files\Events\Node\FilesystemTornDownEvent;
use OCP\Files\Events\UserHomeSetupEvent;
use OCP\Files\ISetupManager;
use OCP\Files\Mount\IExternalMountPoint;
use OCP\Files\Mount\IMountManager;
use OCP\Files\Mount\IMountPoint;
use OCP\Files\Mount\ISharedMountPoint;
use OCP\Files\NotFoundException;
use OCP\Files\Storage\IStorage;
use OCP\Group\Events\UserAddedEvent;
Expand Down Expand Up @@ -191,15 +189,15 @@ function ($mountPoint, IStorage $storage, IMountPoint $mount) use ($reSharingEna

// install storage availability wrapper, before most other wrappers
Filesystem::addStorageWrapper('oc_availability', function ($mountPoint, IStorage $storage, IMountPoint $mount) {
$externalMount = $mount instanceof ExternalMountPoint || $mount instanceof Mount;
$externalMount = $mount instanceof IExternalMountPoint;
if ($externalMount && !$storage->isLocal()) {
return new Availability(['storage' => $storage]);
}
return $storage;
});

Filesystem::addStorageWrapper('oc_encoding', function ($mountPoint, IStorage $storage, IMountPoint $mount) {
if ($mount->getOption('encoding_compatibility', false) && !$mount instanceof SharedMount) {
if ($mount->getOption('encoding_compatibility', false) && !$mount instanceof ISharedMountPoint) {
return new Encoding(['storage' => $storage]);
}
return $storage;
Expand Down
23 changes: 23 additions & 0 deletions lib/public/Files/Mount/IExternalMountPoint.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

declare(strict_types=1);

/**
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCP\Files\Mount;

use OCP\AppFramework\Attribute\Implementable;

/**
* Mark the mount points as pointing to a remote server.
*
* These mount point might be temporarily un-available and need special handling.
*
* @since 34.0.0
*/
#[Implementable(since: '34.0.0')]
interface IExternalMountPoint {
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\Files_Sharing;
namespace OCP\Files\Mount;

use OCP\AppFramework\Attribute\Implementable;

/**
* Mark the mount points as pointing to a shared storaged.
*
* @since 34.0.0
*/
#[Implementable(since: '34.0.0')]
interface ISharedMountPoint {

}
Loading