Commit graph

9 commits

Author SHA1 Message Date
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
Vitor Mattos
dc6a0f5e7a
fix: cs
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-08-02 19:12:13 -03:00
Vitor Mattos
566139a231
fix: class namespace
I got the wrong namespace

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-08-02 19:10:21 -03:00
Vitor Mattos
53a97f9a1b
chore: move apply stamp to PDF class
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-08-02 16:17:51 -03:00
Vitor Mattos
29e0e0e488
fix: types
Signed-off-by: Vitor Mattos <vitor@php.rio>
2024-05-31 02:31:46 -03:00
Vitor Mattos
45cd3c374d
chore: Add SPDX header
Signed-off-by: Vitor Mattos <vitor@php.rio>
2024-05-14 12:32:04 -03:00
Vitor Mattos
2d7676dfce
Add header with license
Signed-off-by: Vitor Mattos <vitor@php.rio>
2023-09-26 19:27:41 -03:00
Vitor Mattos
8c1a079ac2
cs:fix
Signed-off-by: Vitor Mattos <vitor@php.rio>
2023-09-26 19:27:40 -03:00
Vitor Mattos
8ed92ff9cc
Use PDFtk to add background to PDF file
Signed-off-by: Vitor Mattos <vitor@php.rio>
2023-09-26 19:27:40 -03:00