libresign/lib
Vitor Mattos 07a231aea2
fix: isolate PHP-pdftk dependency
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>
2025-09-03 09:55:55 -03:00
..
Activity fix: cs 2025-05-23 14:21:29 -03:00
AppInfo chore: unify events after sign a file 2025-08-01 15:39:56 -03:00
BackgroundJob chore: bump dependencies 2024-09-19 10:10:41 -03:00
Command chore: implement Rector 2025-05-21 11:06:17 -03:00
Controller chore: more steps about tests 2025-09-01 09:35:07 -03:00
DataObjects chore: make possible to don't have an image as signature 2025-04-11 10:42:55 -03:00
Db fix: use UTC into all dates 2025-09-02 13:28:26 -03:00
Events chore: cover with tests and improve make class to be testable 2025-08-02 20:03:06 -03:00
Exception fix: turn sign setup optional at development environment 2024-06-11 16:55:36 -03:00
Files chore: implement Rector 2025-05-21 11:06:17 -03:00
Handler fix: isolate PHP-pdftk dependency 2025-09-03 09:55:55 -03:00
Helper fix: split errors 2025-08-20 09:10:37 -03:00
Listener fix: use UTC into all dates 2025-09-02 13:28:26 -03:00
Middleware fix: psalm issue 2025-08-20 09:09:50 -03:00
Migration fix: use UTC into all dates 2025-09-02 13:28:26 -03:00
Notification fix: show 'Dismiss notification' button on signed file notification 2025-05-24 23:26:07 -04:00
Service fix: use UTC into all dates 2025-09-02 13:28:26 -03:00
Settings chore: rename URL to CPS and return this at get certificate details endpoint 2025-04-17 14:12:41 -03:00
Capabilities.php chore: make frontend compatible with custom width and height 2025-04-11 10:44:03 -03:00
ResponseDefinitions.php fix: documentation 2025-04-17 15:30:12 -03:00