From f856c7f4f2ad7b0a7a599f055bbcf85f70bbeb08 Mon Sep 17 00:00:00 2001 From: PT-ATA No One Date: Mon, 25 Nov 2024 08:00:00 +0000 Subject: [PATCH] ignore folders for scoping --- composer.json | 1 + scoper.inc.php | 29 +++++++++++++++++++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index b9573f14..70ccdda1 100644 --- a/composer.json +++ b/composer.json @@ -22,6 +22,7 @@ "autoload": { "psr-4": { "OCP\\": "vendor/nextcloud/ocp/OCP", + "OCA\\Files_Trashbin\\": "nextcloud-server/apps/files_trashbin", "OCA\\GDataVaas\\": "lib" } }, diff --git a/scoper.inc.php b/scoper.inc.php index cac83acd..5a3b8c7e 100644 --- a/scoper.inc.php +++ b/scoper.inc.php @@ -20,15 +20,32 @@ // ), // ); $excludedFiles = [ - 'templates/admin.php', - 'templates/exception.php', - 'templates/xml_exception.php', - 'src/admin-settings.js', - 'src/files-action.js', - 'src/main.js', 'css/style.css', 'LICENSES/AGPL-3.0-or-later.txt' ]; +$excludedFolders = array_merge( + array_map( + static fn (SplFileInfo $fileInfo) => $fileInfo->getPathname(), + iterator_to_array( + Finder::create() + ->in('templates') + ->files(), + false, + ), + ), + array_map( + static fn (SplFileInfo $fileInfo) => $fileInfo->getPathname(), + iterator_to_array( + Finder::create() + ->in('src') + ->files(), + false, + ), +)); + +exit(); + +$excludedFiles = array_merge($excludedFiles, $excludedFolders); return [ // The prefix configuration. If a non-null value is used, a random prefix