2013-02-10 08:42:23 -05:00
|
|
|
<?php
|
2024-05-28 10:42:42 -04:00
|
|
|
|
2013-02-10 08:42:23 -05:00
|
|
|
/**
|
2024-05-28 10:42:42 -04:00
|
|
|
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2013-02-10 08:42:23 -05:00
|
|
|
*/
|
2015-03-21 15:12:55 -04:00
|
|
|
namespace OCA\Files;
|
|
|
|
|
|
|
|
|
|
use OCP\Capabilities\ICapability;
|
2016-02-24 05:00:20 -05:00
|
|
|
use OCP\IConfig;
|
2015-03-21 15:12:55 -04:00
|
|
|
|
|
|
|
|
class Capabilities implements ICapability {
|
2019-11-25 08:09:38 -05:00
|
|
|
|
2022-06-03 01:15:17 -04:00
|
|
|
protected IConfig $config;
|
2019-11-25 08:09:38 -05:00
|
|
|
|
2022-06-03 01:15:17 -04:00
|
|
|
public function __construct(IConfig $config) {
|
2016-02-24 05:00:20 -05:00
|
|
|
$this->config = $config;
|
|
|
|
|
}
|
2015-03-21 15:12:55 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Return this classes capabilities
|
2023-06-14 08:43:41 -04:00
|
|
|
*
|
2024-02-22 20:25:23 -05:00
|
|
|
* @return array{files: array{bigfilechunking: bool, blacklisted_files: array<mixed>, forbidden_filename_characters: array<string>}}
|
2015-03-21 15:12:55 -04:00
|
|
|
*/
|
|
|
|
|
public function getCapabilities() {
|
|
|
|
|
return [
|
|
|
|
|
'files' => [
|
|
|
|
|
'bigfilechunking' => true,
|
2024-02-22 20:25:23 -05:00
|
|
|
'blacklisted_files' => (array)$this->config->getSystemValue('blacklisted_files', ['.htaccess']),
|
|
|
|
|
'forbidden_filename_characters' => \OCP\Util::getForbiddenFileNameChars(),
|
2015-03-21 15:12:55 -04:00
|
|
|
],
|
|
|
|
|
];
|
2013-02-10 08:42:23 -05:00
|
|
|
}
|
2013-08-18 05:02:08 -04:00
|
|
|
}
|