diff options
44 files changed, 765 insertions, 1115 deletions
diff --git a/.envrc b/.envrc new file mode 100644 index 00000000000..6f3f66b63d9 --- /dev/null +++ b/.envrc @@ -0,0 +1,3 @@ +watch_file lib/versioncheck.php +watch_file package.json +use flake diff --git a/.gitignore b/.gitignore index a55b5c4602b..dfad450a778 100644 --- a/.gitignore +++ b/.gitignore @@ -183,3 +183,5 @@ core/js/mimetypelist.js cypress/downloads cypress/snapshots cypress/videos + +/.direnv diff --git a/.reuse/dep5 b/.reuse/dep5 index 486c713f6aa..4abe782fb68 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -351,6 +351,6 @@ Files: apps/theming/fonts/OpenDyslexic-Bold.otf apps/theming/fonts/OpenDyslexic- Copyright: 2012-2019 Abbie Gonzalez <https://abbiecod.es|support@abbiecod.es>, with Reserved Font Name OpenDyslexic. License: OFL-1.1-RFN -Files: openapi.json +Files: openapi.json .envrc flake.nix flake.lock Copyright: 2025 Nextcloud GmbH and Nextcloud contributors License: AGPL-3.0-or-later diff --git a/apps/files/l10n/cs.js b/apps/files/l10n/cs.js index b6c83a08aee..b28537c6ae4 100644 --- a/apps/files/l10n/cs.js +++ b/apps/files/l10n/cs.js @@ -71,6 +71,7 @@ OC.L10N.register( "Transferred from %1$s on %2$s" : "Převedeno z %1$s na %2$s", "Files compatibility" : "Kompatibilita souborů", "Allow to restrict filenames to ensure files can be synced with all clients. By default all filenames valid on POSIX (e.g. Linux or macOS) are allowed." : "Umožňuje omezit názvy souborů aby bylo zajištěno, že soubory bude možné synchronizovat se všemi klienty. Ve výchozím stavu jsou povoleny veškeré názvy souborů, splňující standard POSIX (např. Linux nebo macOS).", + "After enabling the Windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "Po povolení názvů souborů, kompatibilních s Windows, stávající soubory už nebude možné změnit, ale je možné je přejmenovat na platné nové názvy jejich vlastníkem.", "It is also possible to migrate files automatically after enabling this setting, please refer to the documentation about the occ command." : "Po povolení tohoto natavení je také možné soubory stěhovat automaticky. Další informace viz dokumentace k příkazu occ.", "Enforce Windows compatibility" : "Vynutit kompatibilitu s Windows", "This will block filenames not valid on Windows systems, like using reserved names or special characters. But this will not enforce compatibility of case sensitivity." : "Toto bude blokovat použití názvů souborů, které nejsou platné na strojích s Windows, jako je použití vyhrazených názvů nebo speciálních znaků. Ale nevynutí kompatibilitu v případě rozlišování malých/VELKÝCH písmen.", @@ -96,6 +97,12 @@ OC.L10N.register( "Invalid filename." : "Neplatný název souboru.", "Renamed \"{oldName}\" to \"{newName}\"" : "Přejmenováno „{oldName}“ na „{newName}", "Rename file" : "Přejmenovat soubor", + "Folder" : "Složka", + "Unknown file type" : "Neznámý typ souboru", + "{ext} image" : "{ext}obrázek", + "{ext} video" : "{ext} video", + "{ext} audio" : "{ext} audio", + "{ext} text" : "{ext} text", "Pending" : "Nevyřízené", "Unknown date" : "Neznámé datum", "Clear filter" : "Vyčistit filtr", @@ -106,6 +113,7 @@ OC.L10N.register( "Total rows summary" : "Celkový souhrn řádek", "Toggle selection for all files and folders" : "Vybrat / zrušit výběr všech souborů a složek", "Name" : "Název", + "File type" : "Typ souboru", "Size" : "Velikost", "\"{displayName}\" failed on some elements" : "„{displayName}“ se pro některé prvky nezdařilo", "\"{displayName}\" batch action executed successfully" : "hromadná akce „{displayName}“ úspěšně vykonána", diff --git a/apps/files/l10n/cs.json b/apps/files/l10n/cs.json index 1ee66b0e9c8..4258b4b31f4 100644 --- a/apps/files/l10n/cs.json +++ b/apps/files/l10n/cs.json @@ -69,6 +69,7 @@ "Transferred from %1$s on %2$s" : "Převedeno z %1$s na %2$s", "Files compatibility" : "Kompatibilita souborů", "Allow to restrict filenames to ensure files can be synced with all clients. By default all filenames valid on POSIX (e.g. Linux or macOS) are allowed." : "Umožňuje omezit názvy souborů aby bylo zajištěno, že soubory bude možné synchronizovat se všemi klienty. Ve výchozím stavu jsou povoleny veškeré názvy souborů, splňující standard POSIX (např. Linux nebo macOS).", + "After enabling the Windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner." : "Po povolení názvů souborů, kompatibilních s Windows, stávající soubory už nebude možné změnit, ale je možné je přejmenovat na platné nové názvy jejich vlastníkem.", "It is also possible to migrate files automatically after enabling this setting, please refer to the documentation about the occ command." : "Po povolení tohoto natavení je také možné soubory stěhovat automaticky. Další informace viz dokumentace k příkazu occ.", "Enforce Windows compatibility" : "Vynutit kompatibilitu s Windows", "This will block filenames not valid on Windows systems, like using reserved names or special characters. But this will not enforce compatibility of case sensitivity." : "Toto bude blokovat použití názvů souborů, které nejsou platné na strojích s Windows, jako je použití vyhrazených názvů nebo speciálních znaků. Ale nevynutí kompatibilitu v případě rozlišování malých/VELKÝCH písmen.", @@ -94,6 +95,12 @@ "Invalid filename." : "Neplatný název souboru.", "Renamed \"{oldName}\" to \"{newName}\"" : "Přejmenováno „{oldName}“ na „{newName}", "Rename file" : "Přejmenovat soubor", + "Folder" : "Složka", + "Unknown file type" : "Neznámý typ souboru", + "{ext} image" : "{ext}obrázek", + "{ext} video" : "{ext} video", + "{ext} audio" : "{ext} audio", + "{ext} text" : "{ext} text", "Pending" : "Nevyřízené", "Unknown date" : "Neznámé datum", "Clear filter" : "Vyčistit filtr", @@ -104,6 +111,7 @@ "Total rows summary" : "Celkový souhrn řádek", "Toggle selection for all files and folders" : "Vybrat / zrušit výběr všech souborů a složek", "Name" : "Název", + "File type" : "Typ souboru", "Size" : "Velikost", "\"{displayName}\" failed on some elements" : "„{displayName}“ se pro některé prvky nezdařilo", "\"{displayName}\" batch action executed successfully" : "hromadná akce „{displayName}“ úspěšně vykonána", diff --git a/apps/files/l10n/ga.js b/apps/files/l10n/ga.js index 232c98146f3..a52a16fb4b4 100644 --- a/apps/files/l10n/ga.js +++ b/apps/files/l10n/ga.js @@ -98,6 +98,11 @@ OC.L10N.register( "Renamed \"{oldName}\" to \"{newName}\"" : "Athainmnithe \"{oldName}\" go \"{newName}\"", "Rename file" : "Athainmnigh an comhad", "Folder" : "Fillteán", + "Unknown file type" : "Cineál comhaid anaithnid", + "{ext} image" : "íomhá {ext}", + "{ext} video" : "físeán {ext}", + "{ext} audio" : "fuaim {ext}", + "{ext} text" : "téacs {ext}", "Pending" : "Ar feitheamh", "Unknown date" : "Dáta anaithnid", "Clear filter" : "Glan an scagaire", @@ -108,6 +113,7 @@ OC.L10N.register( "Total rows summary" : "Achoimre ar na sraitheanna iomlána", "Toggle selection for all files and folders" : "Scoránaigh an roghnúchán do gach comhad agus fillteán", "Name" : "Ainm", + "File type" : "Cineál comhaid", "Size" : "Méid", "\"{displayName}\" failed on some elements" : "\"{displayName}\" theip ar roinnt gnéithe", "\"{displayName}\" batch action executed successfully" : "D'éirigh le beart baisce \"{displayName}\" a rith", @@ -186,6 +192,7 @@ OC.L10N.register( "Sort favorites first" : "Sórtáil na cinn is ansa leat ar dtús", "Sort folders before files" : "Sórtáil fillteáin roimh chomhaid", "Show hidden files" : "Taispeáin comhaid i bhfolach", + "Show file type column" : "Taispeáin colún cineál comhaid", "Crop image previews" : "Réamhamhairc íomhá barr", "Enable the grid view" : "Cumasaigh an radharc greille", "Enable folder tree" : "Cumasaigh crann fillteáin", diff --git a/apps/files/l10n/ga.json b/apps/files/l10n/ga.json index db09fb79b39..2da61d98e94 100644 --- a/apps/files/l10n/ga.json +++ b/apps/files/l10n/ga.json @@ -96,6 +96,11 @@ "Renamed \"{oldName}\" to \"{newName}\"" : "Athainmnithe \"{oldName}\" go \"{newName}\"", "Rename file" : "Athainmnigh an comhad", "Folder" : "Fillteán", + "Unknown file type" : "Cineál comhaid anaithnid", + "{ext} image" : "íomhá {ext}", + "{ext} video" : "físeán {ext}", + "{ext} audio" : "fuaim {ext}", + "{ext} text" : "téacs {ext}", "Pending" : "Ar feitheamh", "Unknown date" : "Dáta anaithnid", "Clear filter" : "Glan an scagaire", @@ -106,6 +111,7 @@ "Total rows summary" : "Achoimre ar na sraitheanna iomlána", "Toggle selection for all files and folders" : "Scoránaigh an roghnúchán do gach comhad agus fillteán", "Name" : "Ainm", + "File type" : "Cineál comhaid", "Size" : "Méid", "\"{displayName}\" failed on some elements" : "\"{displayName}\" theip ar roinnt gnéithe", "\"{displayName}\" batch action executed successfully" : "D'éirigh le beart baisce \"{displayName}\" a rith", @@ -184,6 +190,7 @@ "Sort favorites first" : "Sórtáil na cinn is ansa leat ar dtús", "Sort folders before files" : "Sórtáil fillteáin roimh chomhaid", "Show hidden files" : "Taispeáin comhaid i bhfolach", + "Show file type column" : "Taispeáin colún cineál comhaid", "Crop image previews" : "Réamhamhairc íomhá barr", "Enable the grid view" : "Cumasaigh an radharc greille", "Enable folder tree" : "Cumasaigh crann fillteáin", diff --git a/apps/files/l10n/it.js b/apps/files/l10n/it.js index 03a1cda9804..1394712a176 100644 --- a/apps/files/l10n/it.js +++ b/apps/files/l10n/it.js @@ -99,6 +99,10 @@ OC.L10N.register( "Rename file" : "Rinomina file", "Folder" : "Cartella", "Unknown file type" : "Tipo di file sconosciuto", + "{ext} image" : "{ext} image", + "{ext} video" : "{ext} video", + "{ext} audio" : "{ext} audio", + "{ext} text" : "{ext} text", "Pending" : "In corso", "Unknown date" : "Data sconosciuta", "Clear filter" : "Pulisci il filtro", diff --git a/apps/files/l10n/it.json b/apps/files/l10n/it.json index e83848ed70a..cd91fe47818 100644 --- a/apps/files/l10n/it.json +++ b/apps/files/l10n/it.json @@ -97,6 +97,10 @@ "Rename file" : "Rinomina file", "Folder" : "Cartella", "Unknown file type" : "Tipo di file sconosciuto", + "{ext} image" : "{ext} image", + "{ext} video" : "{ext} video", + "{ext} audio" : "{ext} audio", + "{ext} text" : "{ext} text", "Pending" : "In corso", "Unknown date" : "Data sconosciuta", "Clear filter" : "Pulisci il filtro", diff --git a/apps/files/lib/Helper.php b/apps/files/lib/Helper.php index 82d1cc94934..b1439ac7fa5 100644 --- a/apps/files/lib/Helper.php +++ b/apps/files/lib/Helper.php @@ -9,10 +9,6 @@ namespace OCA\Files; use OC\Files\Filesystem; use OCP\Files\FileInfo; -use OCP\Files\IMimeTypeDetector; -use OCP\Files\NotFoundException; -use OCP\ITagManager; -use OCP\Server; use OCP\Util; /** @@ -20,56 +16,6 @@ use OCP\Util; */ class Helper { /** - * @param string $dir - * @return array - * @throws NotFoundException - */ - public static function buildFileStorageStatistics($dir) { - // information about storage capacities - $storageInfo = \OC_Helper::getStorageInfo($dir); - $l = Util::getL10N('files'); - $maxUploadFileSize = Util::maxUploadFilesize($dir, $storageInfo['free']); - $maxHumanFileSize = Util::humanFileSize($maxUploadFileSize); - $maxHumanFileSize = $l->t('Upload (max. %s)', [$maxHumanFileSize]); - - return [ - 'uploadMaxFilesize' => $maxUploadFileSize, - 'maxHumanFilesize' => $maxHumanFileSize, - 'freeSpace' => $storageInfo['free'], - 'quota' => $storageInfo['quota'], - 'total' => $storageInfo['total'], - 'used' => $storageInfo['used'], - 'usedSpacePercent' => $storageInfo['relative'], - 'owner' => $storageInfo['owner'], - 'ownerDisplayName' => $storageInfo['ownerDisplayName'], - 'mountType' => $storageInfo['mountType'], - 'mountPoint' => $storageInfo['mountPoint'], - ]; - } - - /** - * Determine icon for a given file - * - * @param FileInfo $file file info - * @return string icon URL - */ - public static function determineIcon($file) { - if ($file['type'] === 'dir') { - $icon = Server::get(IMimeTypeDetector::class)->mimeTypeIcon('dir'); - // TODO: move this part to the client side, using mountType - if ($file->isShared()) { - $icon = Server::get(IMimeTypeDetector::class)->mimeTypeIcon('dir-shared'); - } elseif ($file->isMounted()) { - $icon = Server::get(IMimeTypeDetector::class)->mimeTypeIcon('dir-external'); - } - } else { - $icon = Server::get(IMimeTypeDetector::class)->mimeTypeIcon($file->getMimetype()); - } - - return substr($icon, 0, -3) . 'svg'; - } - - /** * Comparator function to sort files alphabetically and have * the directories appear first * @@ -162,20 +108,6 @@ class Helper { } /** - * Format file info for JSON - * @param FileInfo[] $fileInfos file infos - * @return array - */ - public static function formatFileInfos($fileInfos) { - $files = []; - foreach ($fileInfos as $i) { - $files[] = self::formatFileInfo($i); - } - - return $files; - } - - /** * Retrieves the contents of the given directory and * returns it as a sorted array of FileInfo. * @@ -192,43 +124,6 @@ class Helper { } /** - * Populate the result set with file tags - * - * @psalm-template T of array{tags?: list<string>, file_source: int, ...array<string, mixed>} - * @param list<T> $fileList - * @return list<T> file list populated with tags - */ - public static function populateTags(array $fileList, ITagManager $tagManager) { - $tagger = $tagManager->load('files'); - $tags = $tagger->getTagsForObjects(array_map(static fn (array $fileData) => $fileData['file_source'], $fileList)); - - if (!is_array($tags)) { - throw new \UnexpectedValueException('$tags must be an array'); - } - - // Set empty tag array - foreach ($fileList as &$fileData) { - $fileData['tags'] = []; - } - unset($fileData); - - if (!empty($tags)) { - foreach ($tags as $fileId => $fileTags) { - foreach ($fileList as &$fileData) { - if ($fileId !== $fileData['file_source']) { - continue; - } - - $fileData['tags'] = $fileTags; - } - unset($fileData); - } - } - - return $fileList; - } - - /** * Sort the given file info array * * @param FileInfo[] $files files to sort diff --git a/apps/files/tests/HelperTest.php b/apps/files/tests/HelperTest.php index 0cf2812f816..5900e94215c 100644 --- a/apps/files/tests/HelperTest.php +++ b/apps/files/tests/HelperTest.php @@ -2,8 +2,6 @@ use OC\Files\FileInfo; use OCA\Files\Helper; -use OCP\ITagManager; -use OCP\ITags; /** * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors @@ -94,36 +92,4 @@ class HelperTest extends \Test\TestCase { $fileNames ); } - - public function testPopulateTags(): void { - $tagManager = $this->createMock(ITagManager::class); - $tagger = $this->createMock(ITags::class); - - $tagManager->method('load') - ->with('files') - ->willReturn($tagger); - - $data = [ - ['file_source' => 10], - ['file_source' => 22, 'foo' => 'bar'], - ['file_source' => 42, 'x' => 'y'], - ]; - - $tags = [ - 10 => ['tag3'], - 42 => ['tag1', 'tag2'], - ]; - - $tagger->method('getTagsForObjects') - ->with([10, 22, 42]) - ->willReturn($tags); - - $result = Helper::populateTags($data, $tagManager); - - $this->assertSame([ - ['file_source' => 10, 'tags' => ['tag3']], - ['file_source' => 22, 'foo' => 'bar', 'tags' => []], - ['file_source' => 42, 'x' => 'y', 'tags' => ['tag1', 'tag2']], - ], $result); - } } diff --git a/apps/files_sharing/l10n/eu.js b/apps/files_sharing/l10n/eu.js index cb02327f28b..d434a96576e 100644 --- a/apps/files_sharing/l10n/eu.js +++ b/apps/files_sharing/l10n/eu.js @@ -300,6 +300,8 @@ OC.L10N.register( "Expires {relativetime}" : "Iraungitzea: {relativetime}", "this share just expired." : "partekatze hau oraintxe iraungi da.", "Shared with you by {owner}" : "{owner} erabiltzaileak zurekin partekatua", + "Internal shares" : "Barneko partekatzeak", + "External shares" : "Kanpoko sareak", "Link to a file" : "Esteka fitxategi batera", "_Accept share_::_Accept shares_" : ["Onartu partekatzea","Onartu partekatzeak"], "Open in Files" : "Ireki Fitxategiak aplikazioan", diff --git a/apps/files_sharing/l10n/eu.json b/apps/files_sharing/l10n/eu.json index 01e001a7624..cf9789e6592 100644 --- a/apps/files_sharing/l10n/eu.json +++ b/apps/files_sharing/l10n/eu.json @@ -298,6 +298,8 @@ "Expires {relativetime}" : "Iraungitzea: {relativetime}", "this share just expired." : "partekatze hau oraintxe iraungi da.", "Shared with you by {owner}" : "{owner} erabiltzaileak zurekin partekatua", + "Internal shares" : "Barneko partekatzeak", + "External shares" : "Kanpoko sareak", "Link to a file" : "Esteka fitxategi batera", "_Accept share_::_Accept shares_" : ["Onartu partekatzea","Onartu partekatzeak"], "Open in Files" : "Ireki Fitxategiak aplikazioan", diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 446db0b8fcc..23ba9da1568 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -94,6 +94,7 @@ class ShareAPIController extends OCSController { private LoggerInterface $logger, private IProviderFactory $factory, private IMailer $mailer, + private ITagManager $tagManager, private ?string $userId = null, ) { parent::__construct($appName, $request); @@ -472,7 +473,7 @@ class ShareAPIController extends OCSController { $share = $this->formatShare($share); if ($include_tags) { - $share = Helper::populateTags([$share], Server::get(ITagManager::class)); + $share = $this->populateTags([$share]); } else { $share = [$share]; } @@ -847,7 +848,7 @@ class ShareAPIController extends OCSController { } if ($includeTags) { - $formatted = Helper::populateTags($formatted, Server::get(ITagManager::class)); + $formatted = $this->populateTags($formatted); } return $formatted; @@ -1100,8 +1101,7 @@ class ShareAPIController extends OCSController { $formatted = $this->fixMissingDisplayName($formatted); if ($includeTags) { - $formatted = - Helper::populateTags($formatted, Server::get(ITagManager::class)); + $formatted = $this->populateTags($formatted); } return $formatted; @@ -2221,4 +2221,41 @@ class ShareAPIController extends OCSController { throw new OCSException($this->l->t('Failed to generate a unique token')); } } + + /** + * Populate the result set with file tags + * + * @psalm-template T of array{tags?: list<string>, file_source: int, ...array<string, mixed>} + * @param list<T> $fileList + * @return list<T> file list populated with tags + */ + private function populateTags(array $fileList): array { + $tagger = $this->tagManager->load('files'); + $tags = $tagger->getTagsForObjects(array_map(static fn (array $fileData) => $fileData['file_source'], $fileList)); + + if (!is_array($tags)) { + throw new \UnexpectedValueException('$tags must be an array'); + } + + // Set empty tag array + foreach ($fileList as &$fileData) { + $fileData['tags'] = []; + } + unset($fileData); + + if (!empty($tags)) { + foreach ($tags as $fileId => $fileTags) { + foreach ($fileList as &$fileData) { + if ($fileId !== $fileData['file_source']) { + continue; + } + + $fileData['tags'] = $fileTags; + } + unset($fileData); + } + } + + return $fileList; + } } diff --git a/apps/files_sharing/lib/MountProvider.php b/apps/files_sharing/lib/MountProvider.php index 91c392de6eb..24d14630303 100644 --- a/apps/files_sharing/lib/MountProvider.php +++ b/apps/files_sharing/lib/MountProvider.php @@ -55,7 +55,7 @@ class MountProvider implements IMountProvider { // filter out excluded shares and group shares that includes self $shares = array_filter($shares, function (IShare $share) use ($user) { - return $share->getPermissions() > 0 && $share->getShareOwner() !== $user->getUID(); + return $share->getPermissions() > 0 && $share->getShareOwner() !== $user->getUID() && $share->getSharedBy() !== $user->getUID(); }); $superShares = $this->buildSuperShares($shares, $user); diff --git a/apps/files_sharing/tests/ApiTest.php b/apps/files_sharing/tests/ApiTest.php index 4ef9f536cb9..a712903d768 100644 --- a/apps/files_sharing/tests/ApiTest.php +++ b/apps/files_sharing/tests/ApiTest.php @@ -26,6 +26,7 @@ use OCP\IGroupManager; use OCP\IL10N; use OCP\IPreview; use OCP\IRequest; +use OCP\ITagManager; use OCP\IURLGenerator; use OCP\IUserManager; use OCP\Mail\IMailer; @@ -111,6 +112,7 @@ class ApiTest extends TestCase { $logger = $this->createMock(LoggerInterface::class); $providerFactory = $this->createMock(IProviderFactory::class); $mailer = $this->createMock(IMailer::class); + $tagManager = $this->createMock(ITagManager::class); $dateTimeZone->method('getTimeZone')->willReturn(new \DateTimeZone(date_default_timezone_get())); return new ShareAPIController( @@ -131,6 +133,7 @@ class ApiTest extends TestCase { $logger, $providerFactory, $mailer, + $tagManager, $userId, ); } diff --git a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php index 29eae2dc581..02c133ee5d1 100644 --- a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php @@ -28,6 +28,8 @@ use OCP\IGroupManager; use OCP\IL10N; use OCP\IPreview; use OCP\IRequest; +use OCP\ITagManager; +use OCP\ITags; use OCP\IURLGenerator; use OCP\IUser; use OCP\IUserManager; @@ -76,6 +78,7 @@ class ShareAPIControllerTest extends TestCase { private LoggerInterface&MockObject $logger; private IProviderFactory&MockObject $factory; private IMailer&MockObject $mailer; + private ITagManager&MockObject $tagManager; protected function setUp(): void { $this->shareManager = $this->createMock(IManager::class); @@ -111,6 +114,7 @@ class ShareAPIControllerTest extends TestCase { $this->logger = $this->createMock(LoggerInterface::class); $this->factory = $this->createMock(IProviderFactory::class); $this->mailer = $this->createMock(IMailer::class); + $this->tagManager = $this->createMock(ITagManager::class); $this->ocs = new ShareAPIController( $this->appName, @@ -130,6 +134,7 @@ class ShareAPIControllerTest extends TestCase { $this->logger, $this->factory, $this->mailer, + $this->tagManager, $this->currentUser, ); } @@ -157,6 +162,7 @@ class ShareAPIControllerTest extends TestCase { $this->logger, $this->factory, $this->mailer, + $this->tagManager, $this->currentUser, ])->onlyMethods(['formatShare']) ->getMock(); @@ -841,8 +847,8 @@ class ShareAPIControllerTest extends TestCase { $this->logger, $this->factory, $this->mailer, + $this->tagManager, $this->currentUser, - ]) ->onlyMethods(['canAccessShare']) ->getMock(); @@ -1474,6 +1480,7 @@ class ShareAPIControllerTest extends TestCase { $this->logger, $this->factory, $this->mailer, + $this->tagManager, $this->currentUser, ]) ->onlyMethods(['formatShare']) @@ -1816,8 +1823,9 @@ class ShareAPIControllerTest extends TestCase { $this->logger, $this->factory, $this->mailer, + $this->tagManager, $this->currentUser, - ])->setMethods(['formatShare']) + ])->onlyMethods(['formatShare']) ->getMock(); [$userFolder, $path] = $this->getNonSharedUserFile(); @@ -1913,8 +1921,9 @@ class ShareAPIControllerTest extends TestCase { $this->logger, $this->factory, $this->mailer, + $this->tagManager, $this->currentUser, - ])->setMethods(['formatShare']) + ])->onlyMethods(['formatShare']) ->getMock(); $this->request @@ -2338,8 +2347,9 @@ class ShareAPIControllerTest extends TestCase { $this->logger, $this->factory, $this->mailer, + $this->tagManager, $this->currentUser, - ])->setMethods(['formatShare']) + ])->onlyMethods(['formatShare']) ->getMock(); [$userFolder, $path] = $this->getNonSharedUserFile(); @@ -2408,8 +2418,9 @@ class ShareAPIControllerTest extends TestCase { $this->logger, $this->factory, $this->mailer, + $this->tagManager, $this->currentUser, - ])->setMethods(['formatShare']) + ])->onlyMethods(['formatShare']) ->getMock(); [$userFolder, $path] = $this->getNonSharedUserFile(); @@ -2639,8 +2650,9 @@ class ShareAPIControllerTest extends TestCase { $this->logger, $this->factory, $this->mailer, + $this->tagManager, $this->currentUser, - ])->setMethods(['formatShare']) + ])->onlyMethods(['formatShare']) ->getMock(); $userFolder = $this->getMockBuilder(Folder::class)->getMock(); @@ -5138,4 +5150,30 @@ class ShareAPIControllerTest extends TestCase { $node->method('getId')->willReturn(42); return [$userFolder, $node]; } + + public function testPopulateTags(): void { + $tagger = $this->createMock(ITags::class); + $this->tagManager->method('load') + ->with('files') + ->willReturn($tagger); + $data = [ + ['file_source' => 10], + ['file_source' => 22, 'foo' => 'bar'], + ['file_source' => 42, 'x' => 'y'], + ]; + $tags = [ + 10 => ['tag3'], + 42 => ['tag1', 'tag2'], + ]; + $tagger->method('getTagsForObjects') + ->with([10, 22, 42]) + ->willReturn($tags); + + $result = self::invokePrivate($this->ocs, 'populateTags', [$data]); + $this->assertSame([ + ['file_source' => 10, 'tags' => ['tag3']], + ['file_source' => 22, 'foo' => 'bar', 'tags' => []], + ['file_source' => 42, 'x' => 'y', 'tags' => ['tag1', 'tag2']], + ], $result); + } } diff --git a/apps/files_sharing/tests/EncryptedSizePropagationTest.php b/apps/files_sharing/tests/EncryptedSizePropagationTest.php index a416cd14715..6bcded8b3e2 100644 --- a/apps/files_sharing/tests/EncryptedSizePropagationTest.php +++ b/apps/files_sharing/tests/EncryptedSizePropagationTest.php @@ -24,14 +24,19 @@ class EncryptedSizePropagationTest extends SizePropagationTest { protected function setupUser($name, $password = '') { $this->createUser($name, $password); - $tmpFolder = Server::get(ITempManager::class)->getTemporaryFolder(); - $this->registerMount($name, '\OC\Files\Storage\Local', '/' . $name, ['datadir' => $tmpFolder]); + $this->registerMountForUser($name); $this->setupForUser($name, $password); $this->loginWithEncryption($name); return new View('/' . $name . '/files'); } + private function registerMountForUser($user): void { + $tmpFolder = Server::get(ITempManager::class)->getTemporaryFolder(); + $this->registerMount($user, '\OC\Files\Storage\Local', '/' . $user, ['datadir' => $tmpFolder]); + } + protected function loginHelper($user, $create = false, $password = false) { + $this->registerMountForUser($user); $this->setupForUser($user, $password); parent::loginHelper($user, $create, $password); } diff --git a/build/files-checker.php b/build/files-checker.php index 4cbd0874247..4dfc7267e23 100644 --- a/build/files-checker.php +++ b/build/files-checker.php @@ -11,6 +11,7 @@ $expectedFiles = [ '..', '.devcontainer', '.editorconfig', + '.envrc', '.eslintignore', '.eslintrc.js', '.git', @@ -61,6 +62,8 @@ $expectedFiles = [ 'cypress.d.ts', 'cypress', 'dist', + 'flake.lock', + 'flake.nix', 'index.html', 'index.php', 'lib', diff --git a/build/integration/files_features/transfer-ownership.feature b/build/integration/files_features/transfer-ownership.feature index 4e5407cadbb..b7da75421f0 100644 --- a/build/integration/files_features/transfer-ownership.feature +++ b/build/integration/files_features/transfer-ownership.feature @@ -210,19 +210,10 @@ Feature: transfer-ownership And user "user1" accepts last share When transferring ownership from "user0" to "user1" And the command was successful - And As an "user1" - Then Downloaded content when downloading file "/test/somefile.txt" with range "bytes=0-6" should be "This is" And using old dav path And as "user0" the folder "/test" exists And using received transfer folder of "user1" as dav path And as "user1" the folder "/test" does not exist - And As an "user1" - And Getting info of last share - And the OCS status code should be "100" - And Share fields of last share match with - | uid_owner | user1 | - | uid_file_owner | user3 | - | share_with | group1 | Scenario: transferring ownership of folder reshared with group to a user not in the group Given user "user0" exists diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index f1107ecb4a1..ad2ccce5641 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -1401,7 +1401,6 @@ </file> <file src="apps/files/lib/Helper.php"> <UndefinedInterfaceMethod> - <code><![CDATA[$file]]></code> <code><![CDATA[$i]]></code> <code><![CDATA[$i]]></code> <code><![CDATA[$i]]></code> @@ -4383,14 +4382,11 @@ </file> <file src="lib/private/Server.php"> <ImplementedReturnTypeMismatch> - <code><![CDATA[\OCP\Calendar\Resource\IManager]]></code> - <code><![CDATA[\OCP\Calendar\Room\IManager]]></code> <code><![CDATA[\OCP\Files\Folder|null]]></code> </ImplementedReturnTypeMismatch> <LessSpecificReturnStatement> <code><![CDATA[$this->get(IFile::class)]]></code> <code><![CDATA[$this->get(IGroupManager::class)]]></code> - <code><![CDATA[$this->get(INavigationManager::class)]]></code> <code><![CDATA[$this->get(IUserManager::class)]]></code> <code><![CDATA[$this->get(IUserSession::class)]]></code> <code><![CDATA[$this->get(\OCP\Encryption\IManager::class)]]></code> @@ -4399,13 +4395,9 @@ <code><![CDATA[\OC\Encryption\File]]></code> <code><![CDATA[\OC\Encryption\Manager]]></code> <code><![CDATA[\OC\Group\Manager]]></code> - <code><![CDATA[\OC\NavigationManager]]></code> <code><![CDATA[\OC\User\Manager]]></code> <code><![CDATA[\OC\User\Session]]></code> </MoreSpecificReturnType> - <UndefinedDocblockClass> - <code><![CDATA[\OC\OCSClient]]></code> - </UndefinedDocblockClass> </file> <file src="lib/private/ServerContainer.php"> <InvalidPropertyAssignmentValue> @@ -4472,39 +4464,13 @@ </UndefinedInterfaceMethod> </file> <file src="lib/private/Share20/ProviderFactory.php"> - <InvalidNullableReturnType> - <code><![CDATA[FederatedShareProvider]]></code> - <code><![CDATA[ShareByMailProvider]]></code> - </InvalidNullableReturnType> <InvalidReturnStatement> <code><![CDATA[$provider]]></code> <code><![CDATA[$provider]]></code> - <code><![CDATA[$this->shareByCircleProvider]]></code> </InvalidReturnStatement> <InvalidReturnType> <code><![CDATA[getProviderForType]]></code> </InvalidReturnType> - <NullableReturnStatement> - <code><![CDATA[null]]></code> - <code><![CDATA[null]]></code> - <code><![CDATA[null]]></code> - <code><![CDATA[null]]></code> - <code><![CDATA[null]]></code> - <code><![CDATA[null]]></code> - </NullableReturnStatement> - <ParamNameMismatch> - <code><![CDATA[$shareProviderClass]]></code> - </ParamNameMismatch> - <UndefinedClass> - <code><![CDATA[\OCA\Circles\ShareByCircleProvider]]></code> - </UndefinedClass> - <UndefinedDocblockClass> - <code><![CDATA[RoomShareProvider]]></code> - <code><![CDATA[\OCA\Circles\ShareByCircleProvider]]></code> - <code><![CDATA[\OCA\Talk\Share\RoomShareProvider]]></code> - <code><![CDATA[private $roomShareProvider = null;]]></code> - <code><![CDATA[private $shareByCircleProvider = null;]]></code> - </UndefinedDocblockClass> </file> <file src="lib/private/Share20/Share.php"> <LessSpecificReturnStatement> diff --git a/build/rector.php b/build/rector.php index 95fcc8d961e..fbd4ae629c1 100644 --- a/build/rector.php +++ b/build/rector.php @@ -63,6 +63,7 @@ $config = RectorConfig::configure() $nextcloudDir . '/remote.php', $nextcloudDir . '/status.php', $nextcloudDir . '/version.php', + $nextcloudDir . '/lib/private/Share20/ProviderFactory.php', // $nextcloudDir . '/config', // $nextcloudDir . '/lib', // $nextcloudDir . '/tests', diff --git a/core/l10n/cs.js b/core/l10n/cs.js index 6da5fca3241..eba9d87be63 100644 --- a/core/l10n/cs.js +++ b/core/l10n/cs.js @@ -80,8 +80,96 @@ OC.L10N.register( "%s (incompatible)" : "%s (nekompatibilní)", "The following apps have been disabled: %s" : "Následující aplikace byly vypnuty: %s", "Already up to date" : "Už je aktuální", + "Windows Command Script" : "Windows cmd skript", + "Electronic book document" : "Dokument – elektronická knížka", + "TrueType Font Collection" : "Sada TrueType písem", + "GPX geographic data" : "Geografická data GPX", + "Gzip archive" : "Gzip archiv", + "Adobe Illustrator document" : "Dokument Adobe Illustrator", + "Java source code" : "Zdrojový kód v Javě", + "JavaScript source code" : "Zdrojový kód v JavaScriptu", + "JSON document" : "JSON dokument", + "Microsoft Access database" : "Databáze Microsoft Access", + "Microsoft OneNote document" : "Dokument Microsoft OneNote", + "Microsoft Word document" : "Dokument Microsoft Word", "Unknown" : "Neznámé", + "PDF document" : "PDF dokument", + "PostScript document" : "PostScript dokument", + "RSS summary" : "RSS shrnutí", + "Android package" : "Balíček pro Android", + "KML geographic data" : "Geografická data KML", + "Excel spreadsheet" : "Sešit Excel", + "Excel add-in" : "Doplněk do Excel", + "Excel spreadsheet template" : "Šablona sešitu Excel", + "Outlook Message" : "Outlook zpráva", + "PowerPoint presentation" : "PowerPoint prezentace", + "PowerPoint add-in" : "Doplněk do PowerPoint", + "PowerPoint presentation template" : "Šablona prezentace PowerPoint", + "Word document" : "Dokument Word", + "ODF formula" : "ODF vzorec", + "ODG drawing" : "ODG kresba", + "ODG template" : "ODG šablona", + "ODP presentation" : "ODP prezentace", + "ODP template" : "ODP šablona", + "ODS spreadsheet" : "ODS šablona", + "ODS template" : "ODS šablona", + "ODT document" : "ODT dokument", + "ODT template" : "ODT šablona", + "PowerPoint 2007 presentation" : "Prezentace PowerPoint 2007", + "PowerPoint 2007 show" : "Show PowerPoint 2007", + "WordPerfect document" : "WordPerfect dolument", + "7-zip archive" : "7-zip archiv", + "Blender scene" : "Scéna v Blenderu", + "Bzip2 archive" : "Bzip2 archiv", + "Debian package" : "Debian balíček", + "FictionBook document" : "FictionBook dokument", + "Unknown font" : "Neznámé písmo", + "Krita document" : "Krita dokument", + "Mobipocket e-book" : "Mobipocket e-kniha", + "Perl script" : "Perl skript", + "PHP script" : "PHP skript", + "Tar archive" : "Tar archiv", + "XML document" : "XML dokument", + "YAML document" : "YAML dokument", + "Zip archive" : "Zip archiv", + "Zstandard archive" : "Zstandard archiv", + "AAC audio" : "AAC audio", + "FLAC audio" : "FLAC audio", + "MPEG-4 audio" : "MPEG-4 audio", + "MP3 audio" : "MP3 audio", + "Ogg audio" : "Ogg audio", + "WebM audio" : "WebM audio", + "EMF image" : "EMF obrázek", + "GIF image" : "GIF obrázek", + "HEIC image" : "HEIC obrázek", + "HEIF image" : "HEIF obrázek", + "JPEG image" : "JPEG obrázek", "PNG image" : "Obrázek PNG", + "SVG image" : "SVG obrázek", + "TIFF image" : "TIFF obrázek", + "WebP image" : "WebP obrázek", + "Windows Icon" : "Windows ikona", + "Email message" : "E-mailová zpráva", + "VCS/ICS calendar" : "VCS/ICS kalednář", + "CSS stylesheet" : "CSS kaskádové styly", + "CSV document" : "CSV dokument", + "HTML document" : "HTML dokument", + "Markdown document" : "Markdown dokument", + "Org-mode file" : "soubor Org-mode", + "NFO document" : "NFO dokument", + "PHP source" : "PHP zdrojové kódy", + "Python script" : "Python skript", + "ReStructuredText document" : "ReStructuredText dokument", + "MPEG video" : "MPEG video", + "DV video" : "DV video", + "MPEG-4 video" : "MPEG-4 video", + "Ogg video" : "Ogg video", + "QuickTime video" : "QuickTime video", + "WebM video" : "WebM video", + "Flash video" : "Flash video", + "Matroska video" : "Matroska video", + "Windows Media video" : "Windows Media video", + "AVI video" : "AVI video", "Error occurred while checking server setup" : "Při ověřování nastavení serveru došlo k chybě", "For more details see the {linkstart}documentation ↗{linkend}." : "Podrobnosti naleznete v {linkstart}dokumentaci ↗{linkend}.", "unknown text" : "neznámý text", diff --git a/core/l10n/cs.json b/core/l10n/cs.json index f82d0b6aa56..b99aeb91748 100644 --- a/core/l10n/cs.json +++ b/core/l10n/cs.json @@ -78,8 +78,96 @@ "%s (incompatible)" : "%s (nekompatibilní)", "The following apps have been disabled: %s" : "Následující aplikace byly vypnuty: %s", "Already up to date" : "Už je aktuální", + "Windows Command Script" : "Windows cmd skript", + "Electronic book document" : "Dokument – elektronická knížka", + "TrueType Font Collection" : "Sada TrueType písem", + "GPX geographic data" : "Geografická data GPX", + "Gzip archive" : "Gzip archiv", + "Adobe Illustrator document" : "Dokument Adobe Illustrator", + "Java source code" : "Zdrojový kód v Javě", + "JavaScript source code" : "Zdrojový kód v JavaScriptu", + "JSON document" : "JSON dokument", + "Microsoft Access database" : "Databáze Microsoft Access", + "Microsoft OneNote document" : "Dokument Microsoft OneNote", + "Microsoft Word document" : "Dokument Microsoft Word", "Unknown" : "Neznámé", + "PDF document" : "PDF dokument", + "PostScript document" : "PostScript dokument", + "RSS summary" : "RSS shrnutí", + "Android package" : "Balíček pro Android", + "KML geographic data" : "Geografická data KML", + "Excel spreadsheet" : "Sešit Excel", + "Excel add-in" : "Doplněk do Excel", + "Excel spreadsheet template" : "Šablona sešitu Excel", + "Outlook Message" : "Outlook zpráva", + "PowerPoint presentation" : "PowerPoint prezentace", + "PowerPoint add-in" : "Doplněk do PowerPoint", + "PowerPoint presentation template" : "Šablona prezentace PowerPoint", + "Word document" : "Dokument Word", + "ODF formula" : "ODF vzorec", + "ODG drawing" : "ODG kresba", + "ODG template" : "ODG šablona", + "ODP presentation" : "ODP prezentace", + "ODP template" : "ODP šablona", + "ODS spreadsheet" : "ODS šablona", + "ODS template" : "ODS šablona", + "ODT document" : "ODT dokument", + "ODT template" : "ODT šablona", + "PowerPoint 2007 presentation" : "Prezentace PowerPoint 2007", + "PowerPoint 2007 show" : "Show PowerPoint 2007", + "WordPerfect document" : "WordPerfect dolument", + "7-zip archive" : "7-zip archiv", + "Blender scene" : "Scéna v Blenderu", + "Bzip2 archive" : "Bzip2 archiv", + "Debian package" : "Debian balíček", + "FictionBook document" : "FictionBook dokument", + "Unknown font" : "Neznámé písmo", + "Krita document" : "Krita dokument", + "Mobipocket e-book" : "Mobipocket e-kniha", + "Perl script" : "Perl skript", + "PHP script" : "PHP skript", + "Tar archive" : "Tar archiv", + "XML document" : "XML dokument", + "YAML document" : "YAML dokument", + "Zip archive" : "Zip archiv", + "Zstandard archive" : "Zstandard archiv", + "AAC audio" : "AAC audio", + "FLAC audio" : "FLAC audio", + "MPEG-4 audio" : "MPEG-4 audio", + "MP3 audio" : "MP3 audio", + "Ogg audio" : "Ogg audio", + "WebM audio" : "WebM audio", + "EMF image" : "EMF obrázek", + "GIF image" : "GIF obrázek", + "HEIC image" : "HEIC obrázek", + "HEIF image" : "HEIF obrázek", + "JPEG image" : "JPEG obrázek", "PNG image" : "Obrázek PNG", + "SVG image" : "SVG obrázek", + "TIFF image" : "TIFF obrázek", + "WebP image" : "WebP obrázek", + "Windows Icon" : "Windows ikona", + "Email message" : "E-mailová zpráva", + "VCS/ICS calendar" : "VCS/ICS kalednář", + "CSS stylesheet" : "CSS kaskádové styly", + "CSV document" : "CSV dokument", + "HTML document" : "HTML dokument", + "Markdown document" : "Markdown dokument", + "Org-mode file" : "soubor Org-mode", + "NFO document" : "NFO dokument", + "PHP source" : "PHP zdrojové kódy", + "Python script" : "Python skript", + "ReStructuredText document" : "ReStructuredText dokument", + "MPEG video" : "MPEG video", + "DV video" : "DV video", + "MPEG-4 video" : "MPEG-4 video", + "Ogg video" : "Ogg video", + "QuickTime video" : "QuickTime video", + "WebM video" : "WebM video", + "Flash video" : "Flash video", + "Matroska video" : "Matroska video", + "Windows Media video" : "Windows Media video", + "AVI video" : "AVI video", "Error occurred while checking server setup" : "Při ověřování nastavení serveru došlo k chybě", "For more details see the {linkstart}documentation ↗{linkend}." : "Podrobnosti naleznete v {linkstart}dokumentaci ↗{linkend}.", "unknown text" : "neznámý text", diff --git a/core/l10n/ga.js b/core/l10n/ga.js index 213dc571b89..155435c0d4f 100644 --- a/core/l10n/ga.js +++ b/core/l10n/ga.js @@ -80,7 +80,125 @@ OC.L10N.register( "%s (incompatible)" : "%s (neamh-chomhoiriúnach)", "The following apps have been disabled: %s" : "Díchumasaíodh na haipeanna seo a leanas:%s", "Already up to date" : "Cheana féin suas chun dáta", + "Windows Command Script" : "Script Ordú Windows", + "Electronic book document" : "Doiciméad leabhar leictreonach", + "TrueType Font Collection" : "Bailiúchán Clónna TrueType", + "Web Open Font Format" : "Formáid Cló Oscailte Gréasáin", + "GPX geographic data" : "Sonraí geografacha GPX", + "Gzip archive" : "Cartlann Gzip", + "Adobe Illustrator document" : "Doiciméad Adobe Illustrator", + "Java source code" : "Cód foinse Java", + "JavaScript source code" : "Cód foinse JavaScript", + "JSON document" : "Doiciméad JSON", + "Microsoft Access database" : "Bunachar sonraí Microsoft Access", + "Microsoft OneNote document" : "Doiciméad Microsoft OneNote", + "Microsoft Word document" : "Doiciméad Microsoft Word", "Unknown" : "Anaithnid", + "PDF document" : "Doiciméad PDF", + "PostScript document" : "Doiciméad PostScript", + "RSS summary" : "Achoimre RSS", + "Android package" : "Pacáiste Android", + "KML geographic data" : "Sonraí geografacha KML", + "KML geographic compressed data" : "Sonraí comhbhrúite geografacha KML", + "Lotus Word Pro document" : "Doiciméad Lotus Word Pro", + "Excel spreadsheet" : "Scarbhileog Excel", + "Excel add-in" : "Breiseán Excel", + "Excel 2007 binary spreadsheet" : "Scarbhileog dhénártha Excel 2007", + "Excel spreadsheet template" : "Teimpléad scarbhileog Excel", + "Outlook Message" : "Teachtaireacht Outlook", + "PowerPoint presentation" : "Cur i láthair PowerPoint", + "PowerPoint add-in" : "Breiseán PowerPoint", + "PowerPoint presentation template" : "Teimpléad cur i láthair PowerPoint", + "Word document" : "Doiciméad Word", + "ODF formula" : "Foirmle ODF", + "ODG drawing" : "Líníocht ODG", + "ODG drawing (Flat XML)" : "Líníocht ODG (XML Cothrom)", + "ODG template" : "Teimpléad ODG", + "ODP presentation" : "Cur i láthair ODP", + "ODP presentation (Flat XML)" : "Cur i láthair ODP (XML Cothrom)", + "ODP template" : "Teimpléad ODP", + "ODS spreadsheet" : "Scarbhileog ODS", + "ODS spreadsheet (Flat XML)" : "Scarbhileog ODS (XML Cothrom)", + "ODS template" : "Teimpléad ODS", + "ODT document" : "Doiciméad ODT", + "ODT document (Flat XML)" : "Doiciméad ODT (XML Cothrom)", + "ODT template" : "Teimpléad ODT", + "PowerPoint 2007 presentation" : "Cur i láthair PowerPoint 2007", + "PowerPoint 2007 show" : "Taispeántas PowerPoint 2007", + "PowerPoint 2007 presentation template" : "Teimpléad cur i láthair PowerPoint 2007", + "Excel 2007 spreadsheet" : "Scarbhileog Excel 2007", + "Excel 2007 spreadsheet template" : "Teimpléad scarbhileog Excel 2007", + "Word 2007 document" : "Doiciméad Word 2007", + "Word 2007 document template" : "Teimpléad doiciméad Word 2007", + "Microsoft Visio document" : "Doiciméad Microsoft Visio", + "WordPerfect document" : "Doiciméad WordPerfect", + "7-zip archive" : "Cartlann 7-zip", + "Blender scene" : "Radharc cumascóra", + "Bzip2 archive" : "Cartlann Bzip2", + "Debian package" : "Pacáiste Debian", + "FictionBook document" : "Doiciméad FictionBook", + "Unknown font" : "Cló anaithnid", + "Krita document" : "Doiciméad Krita", + "Mobipocket e-book" : "Ríomhleabhar Mobipocket", + "Windows Installer package" : "Pacáiste Suiteálaí Windows", + "Perl script" : "Script Perl", + "PHP script" : "Script PHP", + "Tar archive" : "Cartlann Tar", + "XML document" : "Doiciméad XML", + "YAML document" : "Doiciméad YAML", + "Zip archive" : "Cartlann zip", + "Zstandard archive" : "Cartlann Zstandard", + "AAC audio" : "Fuaim AAC", + "FLAC audio" : "Fuaim FLAC", + "MPEG-4 audio" : "Fuaim MPEG-4", + "MP3 audio" : "Fuaim MP3", + "Ogg audio" : "Fuaim Ogg", + "RIFF/WAVe standard Audio" : "Fuaim chaighdeánach RIFF/WAVe", + "WebM audio" : "Fuaim WebM", + "MP3 ShoutCast playlist" : "Seinmliosta MP3 ShoutCast", + "Windows BMP image" : "Íomhá BMP Windows", + "Better Portable Graphics image" : "Íomhá Grafaicí Inaistrithe Níos Fearr", + "EMF image" : "Íomhá EMF", + "GIF image" : "Íomhá GIF", + "HEIC image" : "Íomhá HEIC", + "HEIF image" : "Íomhá HEIF", + "JPEG-2000 JP2 image" : "Íomhá JPEG-2000 JP2", + "JPEG image" : "Íomhá JPEG", + "PNG image" : "Íomhá PNG", + "SVG image" : "Íomhá SVG", + "Truevision Targa image" : "Íomhá Truevision Targa", + "TIFF image" : "Íomhá TIFF", + "WebP image" : "Íomhá WebP", + "Digital raw image" : "Íomhá amh digiteach", + "Windows Icon" : "Deilbhín Windows", + "Email message" : "Teachtaireacht ríomhphoist", + "VCS/ICS calendar" : "Féilire VCS/ICS", + "CSS stylesheet" : "Bileog stíle CSS", + "CSV document" : "Doiciméad CSV", + "HTML document" : "Doiciméad HTML", + "Markdown document" : "Doiciméad marcála síos", + "Org-mode file" : "Comhad mód eagraíochta", + "Plain text document" : "Doiciméad téacs simplí", + "Rich Text document" : "Doiciméad Téacs Saibhir", + "Electronic business card" : "Cárta gnó leictreonach", + "C++ source code" : "Cód foinse C++", + "LDIF address book" : "Leabhar seoltaí LDIF", + "NFO document" : "Doiciméad NFO", + "PHP source" : "Foinse PHP", + "Python script" : "Script Python", + "ReStructuredText document" : "Doiciméad AthstruchtúrthaTéacs", + "3GPP multimedia file" : "Comhad ilmheán 3GPP", + "MPEG video" : "Físeán MPEG", + "DV video" : "Físeán DV", + "MPEG-2 transport stream" : "Sruth iompair MPEG-2", + "MPEG-4 video" : "Físeán MPEG-4", + "Ogg video" : "Físeán Ogg", + "QuickTime video" : "Físeán QuickTime", + "WebM video" : "Físeán WebM", + "Flash video" : "Físeán Flash", + "Matroska video" : "Físeán Matroska", + "Windows Media video" : "Físeán Windows Media", + "AVI video" : "Físeán AVI", "Error occurred while checking server setup" : "Tharla earráid agus socrú an fhreastalaí á sheiceáil", "For more details see the {linkstart}documentation ↗{linkend}." : "Le haghaidh tuilleadh sonraí féach an {linkstart}doiciméadú ↗{linkend}.", "unknown text" : "téacs anaithnid", diff --git a/core/l10n/ga.json b/core/l10n/ga.json index 79196f3e7dd..b4855095364 100644 --- a/core/l10n/ga.json +++ b/core/l10n/ga.json @@ -78,7 +78,125 @@ "%s (incompatible)" : "%s (neamh-chomhoiriúnach)", "The following apps have been disabled: %s" : "Díchumasaíodh na haipeanna seo a leanas:%s", "Already up to date" : "Cheana féin suas chun dáta", + "Windows Command Script" : "Script Ordú Windows", + "Electronic book document" : "Doiciméad leabhar leictreonach", + "TrueType Font Collection" : "Bailiúchán Clónna TrueType", + "Web Open Font Format" : "Formáid Cló Oscailte Gréasáin", + "GPX geographic data" : "Sonraí geografacha GPX", + "Gzip archive" : "Cartlann Gzip", + "Adobe Illustrator document" : "Doiciméad Adobe Illustrator", + "Java source code" : "Cód foinse Java", + "JavaScript source code" : "Cód foinse JavaScript", + "JSON document" : "Doiciméad JSON", + "Microsoft Access database" : "Bunachar sonraí Microsoft Access", + "Microsoft OneNote document" : "Doiciméad Microsoft OneNote", + "Microsoft Word document" : "Doiciméad Microsoft Word", "Unknown" : "Anaithnid", + "PDF document" : "Doiciméad PDF", + "PostScript document" : "Doiciméad PostScript", + "RSS summary" : "Achoimre RSS", + "Android package" : "Pacáiste Android", + "KML geographic data" : "Sonraí geografacha KML", + "KML geographic compressed data" : "Sonraí comhbhrúite geografacha KML", + "Lotus Word Pro document" : "Doiciméad Lotus Word Pro", + "Excel spreadsheet" : "Scarbhileog Excel", + "Excel add-in" : "Breiseán Excel", + "Excel 2007 binary spreadsheet" : "Scarbhileog dhénártha Excel 2007", + "Excel spreadsheet template" : "Teimpléad scarbhileog Excel", + "Outlook Message" : "Teachtaireacht Outlook", + "PowerPoint presentation" : "Cur i láthair PowerPoint", + "PowerPoint add-in" : "Breiseán PowerPoint", + "PowerPoint presentation template" : "Teimpléad cur i láthair PowerPoint", + "Word document" : "Doiciméad Word", + "ODF formula" : "Foirmle ODF", + "ODG drawing" : "Líníocht ODG", + "ODG drawing (Flat XML)" : "Líníocht ODG (XML Cothrom)", + "ODG template" : "Teimpléad ODG", + "ODP presentation" : "Cur i láthair ODP", + "ODP presentation (Flat XML)" : "Cur i láthair ODP (XML Cothrom)", + "ODP template" : "Teimpléad ODP", + "ODS spreadsheet" : "Scarbhileog ODS", + "ODS spreadsheet (Flat XML)" : "Scarbhileog ODS (XML Cothrom)", + "ODS template" : "Teimpléad ODS", + "ODT document" : "Doiciméad ODT", + "ODT document (Flat XML)" : "Doiciméad ODT (XML Cothrom)", + "ODT template" : "Teimpléad ODT", + "PowerPoint 2007 presentation" : "Cur i láthair PowerPoint 2007", + "PowerPoint 2007 show" : "Taispeántas PowerPoint 2007", + "PowerPoint 2007 presentation template" : "Teimpléad cur i láthair PowerPoint 2007", + "Excel 2007 spreadsheet" : "Scarbhileog Excel 2007", + "Excel 2007 spreadsheet template" : "Teimpléad scarbhileog Excel 2007", + "Word 2007 document" : "Doiciméad Word 2007", + "Word 2007 document template" : "Teimpléad doiciméad Word 2007", + "Microsoft Visio document" : "Doiciméad Microsoft Visio", + "WordPerfect document" : "Doiciméad WordPerfect", + "7-zip archive" : "Cartlann 7-zip", + "Blender scene" : "Radharc cumascóra", + "Bzip2 archive" : "Cartlann Bzip2", + "Debian package" : "Pacáiste Debian", + "FictionBook document" : "Doiciméad FictionBook", + "Unknown font" : "Cló anaithnid", + "Krita document" : "Doiciméad Krita", + "Mobipocket e-book" : "Ríomhleabhar Mobipocket", + "Windows Installer package" : "Pacáiste Suiteálaí Windows", + "Perl script" : "Script Perl", + "PHP script" : "Script PHP", + "Tar archive" : "Cartlann Tar", + "XML document" : "Doiciméad XML", + "YAML document" : "Doiciméad YAML", + "Zip archive" : "Cartlann zip", + "Zstandard archive" : "Cartlann Zstandard", + "AAC audio" : "Fuaim AAC", + "FLAC audio" : "Fuaim FLAC", + "MPEG-4 audio" : "Fuaim MPEG-4", + "MP3 audio" : "Fuaim MP3", + "Ogg audio" : "Fuaim Ogg", + "RIFF/WAVe standard Audio" : "Fuaim chaighdeánach RIFF/WAVe", + "WebM audio" : "Fuaim WebM", + "MP3 ShoutCast playlist" : "Seinmliosta MP3 ShoutCast", + "Windows BMP image" : "Íomhá BMP Windows", + "Better Portable Graphics image" : "Íomhá Grafaicí Inaistrithe Níos Fearr", + "EMF image" : "Íomhá EMF", + "GIF image" : "Íomhá GIF", + "HEIC image" : "Íomhá HEIC", + "HEIF image" : "Íomhá HEIF", + "JPEG-2000 JP2 image" : "Íomhá JPEG-2000 JP2", + "JPEG image" : "Íomhá JPEG", + "PNG image" : "Íomhá PNG", + "SVG image" : "Íomhá SVG", + "Truevision Targa image" : "Íomhá Truevision Targa", + "TIFF image" : "Íomhá TIFF", + "WebP image" : "Íomhá WebP", + "Digital raw image" : "Íomhá amh digiteach", + "Windows Icon" : "Deilbhín Windows", + "Email message" : "Teachtaireacht ríomhphoist", + "VCS/ICS calendar" : "Féilire VCS/ICS", + "CSS stylesheet" : "Bileog stíle CSS", + "CSV document" : "Doiciméad CSV", + "HTML document" : "Doiciméad HTML", + "Markdown document" : "Doiciméad marcála síos", + "Org-mode file" : "Comhad mód eagraíochta", + "Plain text document" : "Doiciméad téacs simplí", + "Rich Text document" : "Doiciméad Téacs Saibhir", + "Electronic business card" : "Cárta gnó leictreonach", + "C++ source code" : "Cód foinse C++", + "LDIF address book" : "Leabhar seoltaí LDIF", + "NFO document" : "Doiciméad NFO", + "PHP source" : "Foinse PHP", + "Python script" : "Script Python", + "ReStructuredText document" : "Doiciméad AthstruchtúrthaTéacs", + "3GPP multimedia file" : "Comhad ilmheán 3GPP", + "MPEG video" : "Físeán MPEG", + "DV video" : "Físeán DV", + "MPEG-2 transport stream" : "Sruth iompair MPEG-2", + "MPEG-4 video" : "Físeán MPEG-4", + "Ogg video" : "Físeán Ogg", + "QuickTime video" : "Físeán QuickTime", + "WebM video" : "Físeán WebM", + "Flash video" : "Físeán Flash", + "Matroska video" : "Físeán Matroska", + "Windows Media video" : "Físeán Windows Media", + "AVI video" : "Físeán AVI", "Error occurred while checking server setup" : "Tharla earráid agus socrú an fhreastalaí á sheiceáil", "For more details see the {linkstart}documentation ↗{linkend}." : "Le haghaidh tuilleadh sonraí féach an {linkstart}doiciméadú ↗{linkend}.", "unknown text" : "téacs anaithnid", diff --git a/core/l10n/pt_BR.js b/core/l10n/pt_BR.js index 97590c13b40..9f7d646c50d 100644 --- a/core/l10n/pt_BR.js +++ b/core/l10n/pt_BR.js @@ -93,7 +93,7 @@ OC.L10N.register( "Microsoft Access database" : "Banco de dados do Microsoft Access", "Microsoft OneNote document" : "Documento do Microsoft OneNote", "Microsoft Word document" : "Documento do Microsoft Word", - "Unknown" : "Desconhecida", + "Unknown" : "Desconhecido", "PDF document" : "Documento PDF", "PostScript document" : "Documento PostScript", "RSS summary" : "Resumo RSS", @@ -177,6 +177,7 @@ OC.L10N.register( "CSV document" : "Documento CSV", "HTML document" : "Documento HTML", "Markdown document" : "Documento Markdown", + "Org-mode file" : "Arquivo org-mode", "Plain text document" : "Documento de texto simples", "Rich Text document" : "Documento Rich Text", "Electronic business card" : "Cartão de visita eletrônico", diff --git a/core/l10n/pt_BR.json b/core/l10n/pt_BR.json index 3b573b0a9d9..02994ecb5d5 100644 --- a/core/l10n/pt_BR.json +++ b/core/l10n/pt_BR.json @@ -91,7 +91,7 @@ "Microsoft Access database" : "Banco de dados do Microsoft Access", "Microsoft OneNote document" : "Documento do Microsoft OneNote", "Microsoft Word document" : "Documento do Microsoft Word", - "Unknown" : "Desconhecida", + "Unknown" : "Desconhecido", "PDF document" : "Documento PDF", "PostScript document" : "Documento PostScript", "RSS summary" : "Resumo RSS", @@ -175,6 +175,7 @@ "CSV document" : "Documento CSV", "HTML document" : "Documento HTML", "Markdown document" : "Documento Markdown", + "Org-mode file" : "Arquivo org-mode", "Plain text document" : "Documento de texto simples", "Rich Text document" : "Documento Rich Text", "Electronic business card" : "Cartão de visita eletrônico", diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000000..b3c1cbe2593 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1747428706, + "narHash": "sha256-XVds9FkRrY59xRNNq14FNsFGqDiexXX/mlHcX4hPyyk=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "2e1496bf8652ff4af4e4d4737277f71e4a4f5cb2", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000000..95cc8f9c87e --- /dev/null +++ b/flake.nix @@ -0,0 +1,88 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { nixpkgs, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + lib = pkgs.lib; + in + { + devShells.default = + let + php_version = lib.strings.concatStrings (builtins.match ".*PHP_VERSION_ID < ([0-9])0([0-9])00.*" (builtins.readFile ./lib/versioncheck.php)); + php = pkgs.pkgs."php${php_version}".buildEnv { + # Based off https://docs.nextcloud.com/server/latest/admin_manual/installation/php_configuration.html + extensions = ({ enabled, all }: enabled ++ (with all; [ + # Required + ctype + curl + dom + fileinfo + filter + gd + mbstring + openssl + posix + session + simplexml + xmlreader + xmlwriter + zip + zlib + # Database connectors + pdo_sqlite + pdo_mysql + pdo_pgsql + # Recommended + intl + sodium + # Required for specific apps + ldap + smbclient + ftp + imap + # Recommended for specific apps (optional) + gmp + exif + # For enhanced server performance (optional) + apcu + memcached + redis + # For preview generation (optional) + imagick + # For command line processing (optional) + pcntl + + # Debugging + xdebug + ])); + + extraConfig = '' + max_execution_time=300 + memory_limit=-1 + + xdebug.mode=debug + ''; + }; + node_version = builtins.substring 1 (-1) (builtins.elemAt (lib.strings.splitString "." (builtins.fromJSON (builtins.readFile ./package.json)).engines.node) 0); + node = pkgs."nodejs_${node_version}"; + in + pkgs.mkShell { + NOCOVERAGE = 1; + + packages = [ + php + php.packages.composer + node + # Preview generation + pkgs.ffmpeg + pkgs.libreoffice + ]; + }; + } + ); +} diff --git a/lib/base.php b/lib/base.php index 45058db1600..ad80df357c5 100644 --- a/lib/base.php +++ b/lib/base.php @@ -196,7 +196,8 @@ class OC { // Check if config is writable $configFileWritable = is_writable($configFilePath); - if (!$configFileWritable && !OC_Helper::isReadOnlyConfigEnabled() + $configReadOnly = Server::get(IConfig::class)->getSystemValueBool('config_is_read_only'); + if (!$configFileWritable && !$configReadOnly || !$configFileWritable && \OCP\Util::needUpgrade()) { $urlGenerator = Server::get(IURLGenerator::class); $l = Server::get(\OCP\L10N\IFactory::class)->get('lib'); diff --git a/lib/private/Server.php b/lib/private/Server.php index 545ceacbe81..ea8c1ce3797 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -124,10 +124,6 @@ use OC\User\DisplayNameCache; use OC\User\Listeners\BeforeUserDeletedListener; use OC\User\Listeners\UserChangedListener; use OC\User\Session; -use OCA\Files_External\Service\BackendService; -use OCA\Files_External\Service\GlobalStoragesService; -use OCA\Files_External\Service\UserGlobalStoragesService; -use OCA\Files_External\Service\UserStoragesService; use OCA\Theming\ImageManager; use OCA\Theming\Service\BackgroundService; use OCA\Theming\ThemingDefaults; @@ -138,7 +134,6 @@ use OCP\AppFramework\Utility\ITimeFactory; use OCP\Authentication\LoginCredentials\IStore; use OCP\Authentication\Token\IProvider as OCPIProvider; use OCP\BackgroundJob\IJobList; -use OCP\Collaboration\AutoComplete\IManager; use OCP\Collaboration\Reference\IReferenceManager; use OCP\Command\IBus; use OCP\Comments\ICommentsManager; @@ -189,7 +184,6 @@ use OCP\IRequest; use OCP\IRequestId; use OCP\IServerContainer; use OCP\ISession; -use OCP\ITagManager; use OCP\ITempManager; use OCP\IURLGenerator; use OCP\IUserManager; @@ -212,7 +206,6 @@ use OCP\RichObjectStrings\IRichTextFormatter; use OCP\RichObjectStrings\IValidator; use OCP\Route\IRouter; use OCP\Security\Bruteforce\IThrottler; -use OCP\Security\IContentSecurityPolicyManager; use OCP\Security\ICredentialsManager; use OCP\Security\ICrypto; use OCP\Security\IHasher; @@ -1125,7 +1118,7 @@ class Server extends ServerContainer implements IServerContainer { $config = $c->get(\OCP\IConfig::class); $factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class); /** @var \OCP\Share\IProviderFactory $factory */ - return new $factoryClass($this); + return $c->get($factoryClass); }); $this->registerAlias(\OCP\Share\IManager::class, \OC\Share20\Manager::class); @@ -1305,30 +1298,6 @@ class Server extends ServerContainer implements IServerContainer { $hookConnector->viewToNode(); } - /** - * @return \OCP\Calendar\IManager - * @deprecated 20.0.0 - */ - public function getCalendarManager() { - return $this->get(\OC\Calendar\Manager::class); - } - - /** - * @return \OCP\Calendar\Resource\IManager - * @deprecated 20.0.0 - */ - public function getCalendarResourceBackendManager() { - return $this->get(\OC\Calendar\Resource\Manager::class); - } - - /** - * @return \OCP\Calendar\Room\IManager - * @deprecated 20.0.0 - */ - public function getCalendarRoomBackendManager() { - return $this->get(\OC\Calendar\Room\Manager::class); - } - private function connectDispatcher(): void { /** @var IEventDispatcher $eventDispatcher */ $eventDispatcher = $this->get(IEventDispatcher::class); @@ -1366,14 +1335,6 @@ class Server extends ServerContainer implements IServerContainer { } /** - * @return \OCP\Encryption\Keys\IStorage - * @deprecated 20.0.0 - */ - public function getEncryptionKeyStorage() { - return $this->get(IStorage::class); - } - - /** * The current request object holding all information about the request * currently being processed is returned from this method. * In case the current execution was not initiated by a web request null is returned @@ -1386,61 +1347,6 @@ class Server extends ServerContainer implements IServerContainer { } /** - * Returns the preview manager which can create preview images for a given file - * - * @return IPreview - * @deprecated 20.0.0 - */ - public function getPreviewManager() { - return $this->get(IPreview::class); - } - - /** - * Returns the tag manager which can get and set tags for different object types - * - * @see \OCP\ITagManager::load() - * @return ITagManager - * @deprecated 20.0.0 - */ - public function getTagManager() { - return $this->get(ITagManager::class); - } - - /** - * Returns the system-tag manager - * - * @return ISystemTagManager - * - * @since 9.0.0 - * @deprecated 20.0.0 - */ - public function getSystemTagManager() { - return $this->get(ISystemTagManager::class); - } - - /** - * Returns the system-tag object mapper - * - * @return ISystemTagObjectMapper - * - * @since 9.0.0 - * @deprecated 20.0.0 - */ - public function getSystemTagObjectMapper() { - return $this->get(ISystemTagObjectMapper::class); - } - - /** - * Returns the avatar manager, used for avatar functionality - * - * @return IAvatarManager - * @deprecated 20.0.0 - */ - public function getAvatarManager() { - return $this->get(IAvatarManager::class); - } - - /** * Returns the root folder of ownCloud's data directory * * @return IRootFolder @@ -1524,22 +1430,6 @@ class Server extends ServerContainer implements IServerContainer { } /** - * @return \OC\Authentication\TwoFactorAuth\Manager - * @deprecated 20.0.0 - */ - public function getTwoFactorAuthManager() { - return $this->get(\OC\Authentication\TwoFactorAuth\Manager::class); - } - - /** - * @return \OC\NavigationManager - * @deprecated 20.0.0 - */ - public function getNavigationManager() { - return $this->get(INavigationManager::class); - } - - /** * @return \OCP\IConfig * @deprecated 20.0.0 */ @@ -1556,16 +1446,6 @@ class Server extends ServerContainer implements IServerContainer { } /** - * Returns the app config manager - * - * @return IAppConfig - * @deprecated 20.0.0 - */ - public function getAppConfig() { - return $this->get(IAppConfig::class); - } - - /** * @return IFactory * @deprecated 20.0.0 */ @@ -1594,14 +1474,6 @@ class Server extends ServerContainer implements IServerContainer { } /** - * @return AppFetcher - * @deprecated 20.0.0 - */ - public function getAppFetcher() { - return $this->get(AppFetcher::class); - } - - /** * Returns an ICache instance. Since 8.1.0 it returns a fake cache. Use * getMemCacheFactory() instead. * @@ -1623,17 +1495,6 @@ class Server extends ServerContainer implements IServerContainer { } /** - * Returns an \OC\RedisFactory instance - * - * @return \OC\RedisFactory - * @deprecated 20.0.0 - */ - public function getGetRedisFactory() { - return $this->get('RedisFactory'); - } - - - /** * Returns the current session * * @return \OCP\IDBConnection @@ -1664,25 +1525,6 @@ class Server extends ServerContainer implements IServerContainer { } /** - * @return ILogFactory - * @throws \OCP\AppFramework\QueryException - * @deprecated 20.0.0 - */ - public function getLogFactory() { - return $this->get(ILogFactory::class); - } - - /** - * Returns a router for generating and matching urls - * - * @return IRouter - * @deprecated 20.0.0 - */ - public function getRouter() { - return $this->get(IRouter::class); - } - - /** * Returns a SecureRandom instance * * @return \OCP\Security\ISecureRandom @@ -1713,16 +1555,6 @@ class Server extends ServerContainer implements IServerContainer { } /** - * Returns a CredentialsManager instance - * - * @return ICredentialsManager - * @deprecated 20.0.0 - */ - public function getCredentialsManager() { - return $this->get(ICredentialsManager::class); - } - - /** * Get the certificate manager * * @return \OCP\ICertificateManager @@ -1732,40 +1564,6 @@ class Server extends ServerContainer implements IServerContainer { } /** - * Returns an instance of the HTTP client service - * - * @return IClientService - * @deprecated 20.0.0 - */ - public function getHTTPClientService() { - return $this->get(IClientService::class); - } - - /** - * Get the active event logger - * - * The returned logger only logs data when debug mode is enabled - * - * @return IEventLogger - * @deprecated 20.0.0 - */ - public function getEventLogger() { - return $this->get(IEventLogger::class); - } - - /** - * Get the active query logger - * - * The returned logger only logs data when debug mode is enabled - * - * @return IQueryLogger - * @deprecated 20.0.0 - */ - public function getQueryLogger() { - return $this->get(IQueryLogger::class); - } - - /** * Get the manager for temporary files and folders * * @return \OCP\ITempManager @@ -1806,66 +1604,6 @@ class Server extends ServerContainer implements IServerContainer { } /** - * @return \OC\OCSClient - * @deprecated 20.0.0 - */ - public function getOcsClient() { - return $this->get('OcsClient'); - } - - /** - * @return IDateTimeZone - * @deprecated 20.0.0 - */ - public function getDateTimeZone() { - return $this->get(IDateTimeZone::class); - } - - /** - * @return IDateTimeFormatter - * @deprecated 20.0.0 - */ - public function getDateTimeFormatter() { - return $this->get(IDateTimeFormatter::class); - } - - /** - * @return IMountProviderCollection - * @deprecated 20.0.0 - */ - public function getMountProviderCollection() { - return $this->get(IMountProviderCollection::class); - } - - /** - * Get the IniWrapper - * - * @return IniGetWrapper - * @deprecated 20.0.0 - */ - public function getIniWrapper() { - return $this->get(IniGetWrapper::class); - } - - /** - * @return \OCP\Command\IBus - * @deprecated 20.0.0 - */ - public function getCommandBus() { - return $this->get(IBus::class); - } - - /** - * Get the trusted domain helper - * - * @return TrustedDomainHelper - * @deprecated 20.0.0 - */ - public function getTrustedDomainHelper() { - return $this->get(TrustedDomainHelper::class); - } - - /** * Get the locking provider * * @return ILockingProvider @@ -1877,22 +1615,6 @@ class Server extends ServerContainer implements IServerContainer { } /** - * @return IMountManager - * @deprecated 20.0.0 - **/ - public function getMountManager() { - return $this->get(IMountManager::class); - } - - /** - * @return IUserMountCache - * @deprecated 20.0.0 - */ - public function getUserMountCache() { - return $this->get(IUserMountCache::class); - } - - /** * Get the MimeTypeDetector * * @return IMimeTypeDetector @@ -1913,16 +1635,6 @@ class Server extends ServerContainer implements IServerContainer { } /** - * Get the manager of all the capabilities - * - * @return CapabilitiesManager - * @deprecated 20.0.0 - */ - public function getCapabilitiesManager() { - return $this->get(CapabilitiesManager::class); - } - - /** * Get the Notification Manager * * @return \OCP\Notification\IManager @@ -1934,14 +1646,6 @@ class Server extends ServerContainer implements IServerContainer { } /** - * @return ICommentsManager - * @deprecated 20.0.0 - */ - public function getCommentsManager() { - return $this->get(ICommentsManager::class); - } - - /** * @return \OCA\Theming\ThemingDefaults * @deprecated 20.0.0 */ @@ -1958,14 +1662,6 @@ class Server extends ServerContainer implements IServerContainer { } /** - * @return \OC\Session\CryptoWrapper - * @deprecated 20.0.0 - */ - public function getSessionCryptoWrapper() { - return $this->get('CryptoWrapper'); - } - - /** * @return CsrfTokenManager * @deprecated 20.0.0 */ @@ -1974,22 +1670,6 @@ class Server extends ServerContainer implements IServerContainer { } /** - * @return IThrottler - * @deprecated 20.0.0 - */ - public function getBruteForceThrottler() { - return $this->get(Throttler::class); - } - - /** - * @return IContentSecurityPolicyManager - * @deprecated 20.0.0 - */ - public function getContentSecurityPolicyManager() { - return $this->get(ContentSecurityPolicyManager::class); - } - - /** * @return ContentSecurityPolicyNonceManager * @deprecated 20.0.0 */ @@ -1998,80 +1678,6 @@ class Server extends ServerContainer implements IServerContainer { } /** - * Not a public API as of 8.2, wait for 9.0 - * - * @return \OCA\Files_External\Service\BackendService - * @deprecated 20.0.0 - */ - public function getStoragesBackendService() { - return $this->get(BackendService::class); - } - - /** - * Not a public API as of 8.2, wait for 9.0 - * - * @return \OCA\Files_External\Service\GlobalStoragesService - * @deprecated 20.0.0 - */ - public function getGlobalStoragesService() { - return $this->get(GlobalStoragesService::class); - } - - /** - * Not a public API as of 8.2, wait for 9.0 - * - * @return \OCA\Files_External\Service\UserGlobalStoragesService - * @deprecated 20.0.0 - */ - public function getUserGlobalStoragesService() { - return $this->get(UserGlobalStoragesService::class); - } - - /** - * Not a public API as of 8.2, wait for 9.0 - * - * @return \OCA\Files_External\Service\UserStoragesService - * @deprecated 20.0.0 - */ - public function getUserStoragesService() { - return $this->get(UserStoragesService::class); - } - - /** - * @return \OCP\Share\IManager - * @deprecated 20.0.0 - */ - public function getShareManager() { - return $this->get(\OCP\Share\IManager::class); - } - - /** - * @return \OCP\Collaboration\Collaborators\ISearch - * @deprecated 20.0.0 - */ - public function getCollaboratorSearch() { - return $this->get(\OCP\Collaboration\Collaborators\ISearch::class); - } - - /** - * @return \OCP\Collaboration\AutoComplete\IManager - * @deprecated 20.0.0 - */ - public function getAutoCompleteManager() { - return $this->get(IManager::class); - } - - /** - * Returns the LDAP Provider - * - * @return \OCP\LDAP\ILDAPProvider - * @deprecated 20.0.0 - */ - public function getLDAPProvider() { - return $this->get('LDAPProvider'); - } - - /** * @return \OCP\Settings\IManager * @deprecated 20.0.0 */ @@ -2090,14 +1696,6 @@ class Server extends ServerContainer implements IServerContainer { } /** - * @return \OCP\Lockdown\ILockdownManager - * @deprecated 20.0.0 - */ - public function getLockdownManager() { - return $this->get('LockdownManager'); - } - - /** * @return \OCP\Federation\ICloudIdManager * @deprecated 20.0.0 */ @@ -2105,65 +1703,6 @@ class Server extends ServerContainer implements IServerContainer { return $this->get(ICloudIdManager::class); } - /** - * @return \OCP\GlobalScale\IConfig - * @deprecated 20.0.0 - */ - public function getGlobalScaleConfig() { - return $this->get(IConfig::class); - } - - /** - * @return \OCP\Federation\ICloudFederationProviderManager - * @deprecated 20.0.0 - */ - public function getCloudFederationProviderManager() { - return $this->get(ICloudFederationProviderManager::class); - } - - /** - * @return \OCP\Remote\Api\IApiFactory - * @deprecated 20.0.0 - */ - public function getRemoteApiFactory() { - return $this->get(IApiFactory::class); - } - - /** - * @return \OCP\Federation\ICloudFederationFactory - * @deprecated 20.0.0 - */ - public function getCloudFederationFactory() { - return $this->get(ICloudFederationFactory::class); - } - - /** - * @return \OCP\Remote\IInstanceFactory - * @deprecated 20.0.0 - */ - public function getRemoteInstanceFactory() { - return $this->get(IInstanceFactory::class); - } - - /** - * @return IStorageFactory - * @deprecated 20.0.0 - */ - public function getStorageFactory() { - return $this->get(IStorageFactory::class); - } - - /** - * Get the Preview GeneratorHelper - * - * @return GeneratorHelper - * @since 17.0.0 - * @deprecated 20.0.0 - */ - public function getGeneratorHelper() { - return $this->get(\OC\Preview\GeneratorHelper::class); - } - private function registerDeprecatedAlias(string $alias, string $target) { $this->registerService($alias, function (ContainerInterface $container) use ($target, $alias) { try { diff --git a/lib/private/Share20/ProviderFactory.php b/lib/private/Share20/ProviderFactory.php index 7335c863df0..eba3f4f26f1 100644 --- a/lib/private/Share20/ProviderFactory.php +++ b/lib/private/Share20/ProviderFactory.php @@ -1,32 +1,21 @@ <?php +declare(strict_types=1); + /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. * SPDX-License-Identifier: AGPL-3.0-only */ + namespace OC\Share20; use OC\Share20\Exception\ProviderException; -use OCA\FederatedFileSharing\AddressHandler; use OCA\FederatedFileSharing\FederatedShareProvider; -use OCA\FederatedFileSharing\Notifications; -use OCA\FederatedFileSharing\TokenHandler; -use OCA\ShareByMail\Settings\SettingsManager; use OCA\ShareByMail\ShareByMailProvider; use OCA\Talk\Share\RoomShareProvider; -use OCP\AppFramework\Utility\ITimeFactory; -use OCP\Defaults; -use OCP\EventDispatcher\IEventDispatcher; -use OCP\Federation\ICloudFederationFactory; -use OCP\Files\IRootFolder; -use OCP\Http\Client\IClientService; -use OCP\IServerContainer; -use OCP\L10N\IFactory; -use OCP\Mail\IMailer; -use OCP\Security\IHasher; -use OCP\Security\ISecureRandom; -use OCP\Share\IManager; +use OCP\App\IAppManager; +use OCP\Server; use OCP\Share\IProviderFactory; use OCP\Share\IShare; use OCP\Share\IShareProvider; @@ -38,30 +27,22 @@ use Psr\Log\LoggerInterface; * @package OC\Share20 */ class ProviderFactory implements IProviderFactory { - /** @var DefaultShareProvider */ - private $defaultProvider = null; - /** @var FederatedShareProvider */ - private $federatedProvider = null; - /** @var ShareByMailProvider */ - private $shareByMailProvider; - /** @var \OCA\Circles\ShareByCircleProvider */ - private $shareByCircleProvider = null; - /** @var bool */ - private $circlesAreNotAvailable = false; - /** @var \OCA\Talk\Share\RoomShareProvider */ + private ?DefaultShareProvider $defaultProvider = null; + private ?FederatedShareProvider $federatedProvider = null; + private ?ShareByMailProvider $shareByMailProvider = null; + /** + * @psalm-suppress UndefinedDocblockClass + * @var ?RoomShareProvider + */ private $roomShareProvider = null; - private $registeredShareProviders = []; + private array $registeredShareProviders = []; - private $shareProviders = []; + private array $shareProviders = []; - /** - * IProviderFactory constructor. - * - * @param IServerContainer $serverContainer - */ public function __construct( - private IServerContainer $serverContainer, + protected IAppManager $appManager, + protected LoggerInterface $logger, ) { } @@ -71,81 +52,24 @@ class ProviderFactory implements IProviderFactory { /** * Create the default share provider. - * - * @return DefaultShareProvider */ - protected function defaultShareProvider() { - if ($this->defaultProvider === null) { - $this->defaultProvider = new DefaultShareProvider( - $this->serverContainer->getDatabaseConnection(), - $this->serverContainer->getUserManager(), - $this->serverContainer->getGroupManager(), - $this->serverContainer->get(IRootFolder::class), - $this->serverContainer->get(IMailer::class), - $this->serverContainer->get(Defaults::class), - $this->serverContainer->get(IFactory::class), - $this->serverContainer->getURLGenerator(), - $this->serverContainer->get(ITimeFactory::class), - $this->serverContainer->get(LoggerInterface::class), - $this->serverContainer->get(IManager::class), - ); - } - - return $this->defaultProvider; + protected function defaultShareProvider(): DefaultShareProvider { + return Server::get(DefaultShareProvider::class); } /** * Create the federated share provider - * - * @return FederatedShareProvider */ - protected function federatedShareProvider() { + protected function federatedShareProvider(): ?FederatedShareProvider { if ($this->federatedProvider === null) { /* * Check if the app is enabled */ - $appManager = $this->serverContainer->getAppManager(); - if (!$appManager->isEnabledForUser('federatedfilesharing')) { + if (!$this->appManager->isEnabledForUser('federatedfilesharing')) { return null; } - /* - * TODO: add factory to federated sharing app - */ - $l = $this->serverContainer->getL10N('federatedfilesharing'); - $addressHandler = new AddressHandler( - $this->serverContainer->getURLGenerator(), - $l, - $this->serverContainer->getCloudIdManager() - ); - $notifications = new Notifications( - $addressHandler, - $this->serverContainer->get(IClientService::class), - $this->serverContainer->get(\OCP\OCS\IDiscoveryService::class), - $this->serverContainer->getJobList(), - \OC::$server->getCloudFederationProviderManager(), - \OC::$server->get(ICloudFederationFactory::class), - $this->serverContainer->get(IEventDispatcher::class), - $this->serverContainer->get(LoggerInterface::class), - ); - $tokenHandler = new TokenHandler( - $this->serverContainer->get(ISecureRandom::class) - ); - - $this->federatedProvider = new FederatedShareProvider( - $this->serverContainer->getDatabaseConnection(), - $addressHandler, - $notifications, - $tokenHandler, - $l, - $this->serverContainer->get(IRootFolder::class), - $this->serverContainer->getConfig(), - $this->serverContainer->getUserManager(), - $this->serverContainer->getCloudIdManager(), - $this->serverContainer->getGlobalScaleConfig(), - $this->serverContainer->getCloudFederationProviderManager(), - $this->serverContainer->get(LoggerInterface::class), - ); + $this->federatedProvider = Server::get(FederatedShareProvider::class); } return $this->federatedProvider; @@ -153,90 +77,34 @@ class ProviderFactory implements IProviderFactory { /** * Create the federated share provider - * - * @return ShareByMailProvider */ - protected function getShareByMailProvider() { + protected function getShareByMailProvider(): ?ShareByMailProvider { if ($this->shareByMailProvider === null) { /* * Check if the app is enabled */ - $appManager = $this->serverContainer->getAppManager(); - if (!$appManager->isEnabledForUser('sharebymail')) { + if (!$this->appManager->isEnabledForUser('sharebymail')) { return null; } - $settingsManager = new SettingsManager($this->serverContainer->getConfig()); - - $this->shareByMailProvider = new ShareByMailProvider( - $this->serverContainer->getConfig(), - $this->serverContainer->getDatabaseConnection(), - $this->serverContainer->get(ISecureRandom::class), - $this->serverContainer->getUserManager(), - $this->serverContainer->get(IRootFolder::class), - $this->serverContainer->getL10N('sharebymail'), - $this->serverContainer->get(LoggerInterface::class), - $this->serverContainer->get(IMailer::class), - $this->serverContainer->getURLGenerator(), - $this->serverContainer->getActivityManager(), - $settingsManager, - $this->serverContainer->get(Defaults::class), - $this->serverContainer->get(IHasher::class), - $this->serverContainer->get(IEventDispatcher::class), - $this->serverContainer->get(IManager::class) - ); + $this->shareByMailProvider = Server::get(ShareByMailProvider::class); } return $this->shareByMailProvider; } - - /** - * Create the circle share provider - * - * @return FederatedShareProvider - * - * @suppress PhanUndeclaredClassMethod - */ - protected function getShareByCircleProvider() { - if ($this->circlesAreNotAvailable) { - return null; - } - - if (!$this->serverContainer->getAppManager()->isEnabledForUser('circles') || - !class_exists('\OCA\Circles\ShareByCircleProvider') - ) { - $this->circlesAreNotAvailable = true; - return null; - } - - if ($this->shareByCircleProvider === null) { - $this->shareByCircleProvider = new \OCA\Circles\ShareByCircleProvider( - $this->serverContainer->getDatabaseConnection(), - $this->serverContainer->get(ISecureRandom::class), - $this->serverContainer->getUserManager(), - $this->serverContainer->get(IRootFolder::class), - $this->serverContainer->getL10N('circles'), - $this->serverContainer->get(LoggerInterface::class), - $this->serverContainer->getURLGenerator() - ); - } - - return $this->shareByCircleProvider; - } - /** * Create the room share provider * - * @return RoomShareProvider + * @psalm-suppress UndefinedDocblockClass + * @return ?RoomShareProvider */ protected function getRoomShareProvider() { if ($this->roomShareProvider === null) { /* * Check if the app is enabled */ - $appManager = $this->serverContainer->getAppManager(); - if (!$appManager->isEnabledForUser('spreed')) { + if (!$this->appManager->isEnabledForUser('spreed')) { return null; } @@ -244,9 +112,9 @@ class ProviderFactory implements IProviderFactory { /** * @psalm-suppress UndefinedClass */ - $this->roomShareProvider = $this->serverContainer->get(RoomShareProvider::class); + $this->roomShareProvider = Server::get(RoomShareProvider::class); } catch (\Throwable $e) { - $this->serverContainer->get(LoggerInterface::class)->error( + $this->logger->error( $e->getMessage(), ['exception' => $e] ); @@ -272,8 +140,6 @@ class ProviderFactory implements IProviderFactory { $provider = $this->federatedShareProvider(); } elseif ($id === 'ocMailShare') { $provider = $this->getShareByMailProvider(); - } elseif ($id === 'ocCircleShare') { - $provider = $this->getShareByCircleProvider(); } elseif ($id === 'ocRoomShare') { $provider = $this->getRoomShareProvider(); } @@ -281,10 +147,10 @@ class ProviderFactory implements IProviderFactory { foreach ($this->registeredShareProviders as $shareProvider) { try { /** @var IShareProvider $instance */ - $instance = $this->serverContainer->get($shareProvider); + $instance = Server::get($shareProvider); $this->shareProviders[$instance->identifier()] = $instance; } catch (\Throwable $e) { - $this->serverContainer->get(LoggerInterface::class)->error( + $this->logger->error( $e->getMessage(), ['exception' => $e] ); @@ -318,7 +184,7 @@ class ProviderFactory implements IProviderFactory { } elseif ($shareType === IShare::TYPE_EMAIL) { $provider = $this->getShareByMailProvider(); } elseif ($shareType === IShare::TYPE_CIRCLE) { - $provider = $this->getShareByCircleProvider(); + $provider = $this->getProvider('ocCircleShare'); } elseif ($shareType === IShare::TYPE_ROOM) { $provider = $this->getRoomShareProvider(); } elseif ($shareType === IShare::TYPE_DECK) { @@ -341,10 +207,6 @@ class ProviderFactory implements IProviderFactory { if ($shareByMail !== null) { $shares[] = $shareByMail; } - $shareByCircle = $this->getShareByCircleProvider(); - if ($shareByCircle !== null) { - $shares[] = $shareByCircle; - } $roomShare = $this->getRoomShareProvider(); if ($roomShare !== null) { $shares[] = $roomShare; @@ -353,9 +215,9 @@ class ProviderFactory implements IProviderFactory { foreach ($this->registeredShareProviders as $shareProvider) { try { /** @var IShareProvider $instance */ - $instance = $this->serverContainer->get($shareProvider); + $instance = Server::get($shareProvider); } catch (\Throwable $e) { - $this->serverContainer->get(LoggerInterface::class)->error( + $this->logger->error( $e->getMessage(), ['exception' => $e] ); diff --git a/lib/private/legacy/OC_Helper.php b/lib/private/legacy/OC_Helper.php index a06b15573cb..87c820dcd53 100644 --- a/lib/private/legacy/OC_Helper.php +++ b/lib/private/legacy/OC_Helper.php @@ -199,7 +199,7 @@ class OC_Helper { /** * Try to find a program - * @deprecated 25.0.0 Use \OC\BinaryFinder directly + * @deprecated 25.0.0 Use \OCP\IBinaryFinder directly */ public static function findBinaryPath(string $program): ?string { $result = Server::get(IBinaryFinder::class)->findBinaryPath($program); @@ -415,6 +415,7 @@ class OC_Helper { /** * Returns whether the config file is set manually to read-only * @return bool + * @deprecated 32.0.0 use the `config_is_read_only` system config directly */ public static function isReadOnlyConfigEnabled() { return \OC::$server->getConfig()->getSystemValueBool('config_is_read_only', false); diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index 895cfba35c5..9444da4f36d 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -98,6 +98,7 @@ class OC_Util { * * @param IUser|null $user * @return int|\OCP\Files\FileInfo::SPACE_UNLIMITED|false|float Quota bytes + * @deprecated 9.0.0 - Use \OCP\IUser::getQuota */ public static function getUserQuota(?IUser $user) { if (is_null($user)) { @@ -331,7 +332,7 @@ class OC_Util { } // Check if config folder is writable. - if (!OC_Helper::isReadOnlyConfigEnabled()) { + if (!(bool)$config->getValue('config_is_read_only', false)) { if (!is_writable(OC::$configDir) or !is_readable(OC::$configDir)) { $errors[] = [ 'error' => $l->t('Cannot write into "config" directory.'), diff --git a/lib/public/IServerContainer.php b/lib/public/IServerContainer.php index 82da8779a66..6d5095c92da 100644 --- a/lib/public/IServerContainer.php +++ b/lib/public/IServerContainer.php @@ -8,10 +8,6 @@ declare(strict_types=1); */ namespace OCP; -use OCP\Federation\ICloudFederationFactory; -use OCP\Federation\ICloudFederationProviderManager; -use OCP\Log\ILogFactory; -use OCP\Security\IContentSecurityPolicyManager; use Psr\Container\ContainerInterface; /** @@ -26,35 +22,6 @@ use Psr\Container\ContainerInterface; * @since 6.0.0 */ interface IServerContainer extends ContainerInterface, IContainer { - /** - * The calendar manager will act as a broker between consumers for calendar information and - * providers which actual deliver the calendar information. - * - * @return \OCP\Calendar\IManager - * @since 13.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getCalendarManager(); - - /** - * The calendar resource backend manager will act as a broker between consumers - * for calendar resource information an providers which actual deliver the room information. - * - * @return \OCP\Calendar\Resource\IBackend - * @since 14.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getCalendarResourceBackendManager(); - - /** - * The calendar room backend manager will act as a broker between consumers - * for calendar room information an providers which actual deliver the room information. - * - * @return \OCP\Calendar\Room\IBackend - * @since 14.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getCalendarRoomBackendManager(); /** * The contacts manager will act as a broker between consumers for contacts information and @@ -78,25 +45,6 @@ interface IServerContainer extends ContainerInterface, IContainer { public function getRequest(); /** - * Returns the preview manager which can create preview images for a given file - * - * @return \OCP\IPreview - * @since 6.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getPreviewManager(); - - /** - * Returns the tag manager which can get and set tags for different object types - * - * @see \OCP\ITagManager::load() - * @return \OCP\ITagManager - * @since 6.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getTagManager(); - - /** * Returns the root folder of ownCloud's data directory * * @return \OCP\Files\IRootFolder @@ -144,15 +92,6 @@ interface IServerContainer extends ContainerInterface, IContainer { public function getUserSession(); /** - * Returns the navigation manager - * - * @return \OCP\INavigationManager - * @since 6.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getNavigationManager(); - - /** * Returns the config manager * * @return \OCP\IConfig @@ -189,24 +128,6 @@ interface IServerContainer extends ContainerInterface, IContainer { public function getSecureRandom(); /** - * Returns a CredentialsManager instance - * - * @return \OCP\Security\ICredentialsManager - * @since 9.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getCredentialsManager(); - - /** - * Returns the app config manager - * - * @return \OCP\IAppConfig - * @since 7.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getAppConfig(); - - /** * @return \OCP\L10N\IFactory * @since 8.2.0 * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get @@ -238,13 +159,6 @@ interface IServerContainer extends ContainerInterface, IContainer { public function getEncryptionFilesHelper(); /** - * @return \OCP\Encryption\Keys\IStorage - * @since 8.1.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getEncryptionKeyStorage(); - - /** * Returns the URL generator * * @return \OCP\IURLGenerator @@ -299,15 +213,6 @@ interface IServerContainer extends ContainerInterface, IContainer { public function getDatabaseConnection(); /** - * Returns an avatar manager, used for avatar functionality - * - * @return \OCP\IAvatarManager - * @since 6.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getAvatarManager(); - - /** * Returns an job list for controlling background jobs * * @return \OCP\BackgroundJob\IJobList @@ -317,24 +222,6 @@ interface IServerContainer extends ContainerInterface, IContainer { public function getJobList(); /** - * returns a log factory instance - * - * @return ILogFactory - * @since 14.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getLogFactory(); - - /** - * Returns a router for generating and matching urls - * - * @return \OCP\Route\IRouter - * @since 7.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getRouter(); - - /** * Get the certificate manager * * @return \OCP\ICertificateManager @@ -344,35 +231,6 @@ interface IServerContainer extends ContainerInterface, IContainer { public function getCertificateManager(); /** - * Returns an instance of the HTTP client service - * - * @return \OCP\Http\Client\IClientService - * @since 8.1.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getHTTPClientService(); - - /** - * Get the active event logger - * - * @return \OCP\Diagnostics\IEventLogger - * @since 8.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getEventLogger(); - - /** - * Get the active query logger - * - * The returned logger only logs data when debug mode is enabled - * - * @return \OCP\Diagnostics\IQueryLogger - * @since 8.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getQueryLogger(); - - /** * Get the manager for temporary files and folders * * @return \OCP\ITempManager @@ -400,28 +258,6 @@ interface IServerContainer extends ContainerInterface, IContainer { public function getWebRoot(); /** - * @return \OCP\Files\Config\IMountProviderCollection - * @since 8.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getMountProviderCollection(); - - /** - * Get the IniWrapper - * - * @return \bantu\IniGetWrapper\IniGetWrapper - * @since 8.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getIniWrapper(); - /** - * @return \OCP\Command\IBus - * @since 8.1.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getCommandBus(); - - /** * Creates a new mailer * * @return \OCP\Mail\IMailer @@ -440,13 +276,6 @@ interface IServerContainer extends ContainerInterface, IContainer { public function getLockingProvider(); /** - * @return \OCP\Files\Mount\IMountManager - * @since 8.2.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getMountManager(); - - /** * Get the MimeTypeDetector * * @return \OCP\Files\IMimeTypeDetector @@ -474,108 +303,9 @@ interface IServerContainer extends ContainerInterface, IContainer { public function getNotificationManager(); /** - * @return \OCP\Comments\ICommentsManager - * @since 9.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getCommentsManager(); - - /** - * Returns the system-tag manager - * - * @return \OCP\SystemTag\ISystemTagManager - * - * @since 9.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getSystemTagManager(); - - /** - * Returns the system-tag object mapper - * - * @return \OCP\SystemTag\ISystemTagObjectMapper - * - * @since 9.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getSystemTagObjectMapper(); - - /** - * Returns the share manager - * - * @return \OCP\Share\IManager - * @since 9.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getShareManager(); - - /** - * @return IContentSecurityPolicyManager - * @since 9.0.0 - * @deprecated 17.0.0 Use the AddContentSecurityPolicyEvent - */ - public function getContentSecurityPolicyManager(); - - /** - * @return \OCP\IDateTimeZone - * @since 8.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getDateTimeZone(); - - /** - * @return \OCP\IDateTimeFormatter - * @since 8.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getDateTimeFormatter(); - - /** * @return \OCP\Federation\ICloudIdManager * @since 12.0.0 * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get */ public function getCloudIdManager(); - - /** - * @return \OCP\GlobalScale\IConfig - * @since 14.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getGlobalScaleConfig(); - - /** - * @return ICloudFederationFactory - * @since 14.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getCloudFederationFactory(); - - /** - * @return ICloudFederationProviderManager - * @since 14.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getCloudFederationProviderManager(); - - /** - * @return \OCP\Remote\Api\IApiFactory - * @since 13.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getRemoteApiFactory(); - - /** - * @return \OCP\Remote\IInstanceFactory - * @since 13.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getRemoteInstanceFactory(); - - /** - * @return \OCP\Files\Storage\IStorageFactory - * @since 15.0.0 - * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get - */ - public function getStorageFactory(); } diff --git a/lib/public/Security/IContentSecurityPolicyManager.php b/lib/public/Security/IContentSecurityPolicyManager.php index 3df0da465b2..00cdcc2c454 100644 --- a/lib/public/Security/IContentSecurityPolicyManager.php +++ b/lib/public/Security/IContentSecurityPolicyManager.php @@ -24,7 +24,7 @@ interface IContentSecurityPolicyManager { * Note that the adjustment is only applied to applications that use AppFramework * controllers. * - * To use this from your `app.php` use `\OC::$server->getContentSecurityPolicyManager()->addDefaultPolicy($policy)`, + * To use this from your `app.php` use `\OCP\Server::get(IContentSecurityPolicyManager::class)->addDefaultPolicy($policy)`, * $policy has to be of type `\OCP\AppFramework\Http\ContentSecurityPolicy`. * * WARNING: Using this API incorrectly may make the instance more insecure. diff --git a/lib/public/Share/IProviderFactory.php b/lib/public/Share/IProviderFactory.php index 34656af2d8c..9107274c8c1 100644 --- a/lib/public/Share/IProviderFactory.php +++ b/lib/public/Share/IProviderFactory.php @@ -39,7 +39,8 @@ interface IProviderFactory { /** * @since 21.0.0 - * @param string $shareProvier + * @since 32.0.0 Fix typo in parameter name + * @param string $shareProviderClass */ - public function registerProvider(string $shareProvier): void; + public function registerProvider(string $shareProviderClass): void; } diff --git a/tests/lib/Files/Cache/CacheTest.php b/tests/lib/Files/Cache/CacheTest.php index 55b210a1e2d..2815003a996 100644 --- a/tests/lib/Files/Cache/CacheTest.php +++ b/tests/lib/Files/Cache/CacheTest.php @@ -393,7 +393,7 @@ class CacheTest extends \Test\TestCase { $id4 = $this->cache->put($file4, $fileData['foo2']); $id5 = $this->cache->put($file5, $fileData['foo3']); - $tagManager = \OC::$server->getTagManager()->load('files', [], false, $userId); + $tagManager = \OCP\Server::get(\OCP\ITagManager::class)->load('files', [], false, $userId); $this->assertTrue($tagManager->tagAs($id1, 'tag1')); $this->assertTrue($tagManager->tagAs($id1, 'tag2')); $this->assertTrue($tagManager->tagAs($id2, 'tag2')); diff --git a/tests/lib/Files/FilesystemTest.php b/tests/lib/Files/FilesystemTest.php index 966f6f34cee..529b4f58428 100644 --- a/tests/lib/Files/FilesystemTest.php +++ b/tests/lib/Files/FilesystemTest.php @@ -473,7 +473,7 @@ class FilesystemTest extends \Test\TestCase { $this->assertEquals('/', \OC\Files\Filesystem::getMountPoint('/foo/bar')); $mount = new MountPoint(new Temporary([]), '/foo/bar'); $mountProvider = new DummyMountProvider([self::TEST_FILESYSTEM_USER2 => [$mount]]); - \OC::$server->getMountProviderCollection()->registerProvider($mountProvider); + \OCP\Server::get(\OCP\Files\Config\IMountProviderCollection::class)->registerProvider($mountProvider); $this->assertEquals('/foo/bar/', \OC\Files\Filesystem::getMountPoint('/foo/bar')); } } diff --git a/tests/lib/Files/Node/HookConnectorTest.php b/tests/lib/Files/Node/HookConnectorTest.php index b9e16299dd0..87e83fd0a3b 100644 --- a/tests/lib/Files/Node/HookConnectorTest.php +++ b/tests/lib/Files/Node/HookConnectorTest.php @@ -80,7 +80,7 @@ class HookConnectorTest extends TestCase { Filesystem::getMountManager(), $this->view, \OC::$server->getUserManager()->get($this->userId), - \OC::$server->getUserMountCache(), + \OCP\Server::get(\OCP\Files\Config\IUserMountCache::class), $this->createMock(LoggerInterface::class), $this->createMock(IUserManager::class), $this->createMock(IEventDispatcher::class), diff --git a/tests/lib/Files/Utils/ScannerTest.php b/tests/lib/Files/Utils/ScannerTest.php index 51089e5560c..047da5851b7 100644 --- a/tests/lib/Files/Utils/ScannerTest.php +++ b/tests/lib/Files/Utils/ScannerTest.php @@ -124,7 +124,7 @@ class ScannerTest extends \Test\TestCase { } }); - \OC::$server->getMountProviderCollection()->registerProvider($mountProvider); + \OCP\Server::get(\OCP\Files\Config\IMountProviderCollection::class)->registerProvider($mountProvider); $cache = $storage->getCache(); $storage->mkdir('folder'); diff --git a/tests/lib/Files/ViewTest.php b/tests/lib/Files/ViewTest.php index b790c9ed6e8..d611df372e6 100644 --- a/tests/lib/Files/ViewTest.php +++ b/tests/lib/Files/ViewTest.php @@ -155,7 +155,7 @@ class ViewTest extends \Test\TestCase { $this->userObject->delete(); $this->groupObject->delete(); - $mountProviderCollection = \OC::$server->getMountProviderCollection(); + $mountProviderCollection = \OCP\Server::get(\OCP\Files\Config\IMountProviderCollection::class); self::invokePrivate($mountProviderCollection, 'providers', [[]]); parent::tearDown(); @@ -1626,7 +1626,7 @@ class ViewTest extends \Test\TestCase { ->method('getMountsForUser') ->willReturn($mounts); - $mountProviderCollection = \OC::$server->getMountProviderCollection(); + $mountProviderCollection = \OCP\Server::get(\OCP\Files\Config\IMountProviderCollection::class); $mountProviderCollection->registerProvider($mountProvider); return $mounts; diff --git a/tests/lib/Traits/MountProviderTrait.php b/tests/lib/Traits/MountProviderTrait.php index 6d947d645dd..3bb92f48e20 100644 --- a/tests/lib/Traits/MountProviderTrait.php +++ b/tests/lib/Traits/MountProviderTrait.php @@ -58,6 +58,6 @@ trait MountProviderTrait { return []; } })); - \OC::$server->getMountProviderCollection()->registerProvider($this->mountProvider); + \OCP\Server::get(\OCP\Files\Config\IMountProviderCollection::class)->registerProvider($this->mountProvider); } } |