mirror of
https://github.com/LibreSign/libresign.git
synced 2025-12-17 13:08:48 +01:00
I identified some issues with the follow log: ``` [PHP] Warning: include(): Failed opening '<redacted>/apps/richdocuments/vendor/composer/../mikehaertl/php-pdftk/src/Pdf.php' for inclusion (include_path='<redacted>/3rdparty/pear/archive_tar:/<redacted>/3rdparty/pear/console_getopt:<redacted>/3rdparty/pear/pear-core-minimal/src:/<redacted>/3rdparty/pear/pear_exception:/<redacted>/apps') at /<redacted>/lib/composer/composer/ClassLoader.php#576 GET /ocs/v2.php/apps/libresign/api/v1/file/validate/file_id/2556 ``` It's only occurr when use the app richdocuments, I saw that the package mikehaertl/php-pdftk also is used by this app and because this the autoload was mixed. To solve this issue I used the package humbug/php-scoper that isolate the dependency into a different namespace. I also followed this article: https://arthur-schiwon.de/isolating-nextcloud-app-dependencies-php-scoper And the follow search results to see implementation examples: https://github.com/search?q=OCA+path%3Ascoper.inc.php&type=code https://github.com/search?q=org%3Anextcloud+path%3Ascoper.inc.php&type=code Considering that we already have tests to cover the usage of pdftk, isn't necessary to add new tests, if the test pass, this change worked fine because loaded the isolated packages and the isolated packages made the necessary. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
31 lines
641 B
PHP
31 lines
641 B
PHP
<?php
|
|
|
|
/**
|
|
* SPDX-FileCopyrightText: 2025 LibreCode coop and contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Nextcloud\Rector\Set\NextcloudSets;
|
|
use Rector\Config\RectorConfig;
|
|
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
|
|
|
|
return RectorConfig::configure()
|
|
->withPaths([
|
|
__DIR__ . '/appinfo',
|
|
__DIR__ . '/composer',
|
|
__DIR__ . '/lib',
|
|
__DIR__ . '/templates',
|
|
__DIR__ . '/tests/php',
|
|
])
|
|
->withPhpSets(php81: true)
|
|
->withSets([
|
|
NextcloudSets::NEXTCLOUD_30,
|
|
])
|
|
->withTypeCoverageLevel(0)
|
|
->withSkip([
|
|
ReadOnlyPropertyRector::class,
|
|
__DIR__ . '/lib/Vendor',
|
|
]);
|
|
;
|