No description
Find a file
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
.devcontainer chore: make Nginx acessible outside of localhost 2025-04-11 10:44:05 -03:00
.github chore(deps): Bump shivammathur/setup-php from 2.35.3 to 2.35.4 2025-08-26 05:55:28 +00:00
.tx [tx-robot] Update transifex configuration 2022-10-01 03:16:28 +00:00
appinfo fix: indent using taps 2025-07-21 12:06:44 -03:00
composer chore: Add SPDX header 2024-05-14 12:32:04 -03:00
img feat: rewrite validation page 2024-12-28 18:01:51 -03:00
l10n fix(l10n): Update translations from Transifex 2025-09-02 02:24:35 +00:00
lib fix: isolate PHP-pdftk dependency 2025-09-03 09:55:55 -03:00
LICENSES chore: move license file 2024-10-31 22:35:47 -03:00
src fix: set default value to initial state 2025-09-02 13:51:57 -03:00
templates chore: bump dependencies 2024-11-25 17:33:57 -03:00
tests fix: isolate PHP-pdftk dependency 2025-09-03 09:55:55 -03:00
vendor-bin fix: isolate PHP-pdftk dependency 2025-09-03 09:55:55 -03:00
.editorconfig feat: add spdx 2024-10-26 16:41:27 -03:00
.eslintignore feat: add spdx 2024-10-26 16:41:27 -03:00
.eslintrc.js feat: add spdx 2024-10-26 16:41:27 -03:00
.gitattributes feat: add spdx 2024-10-26 16:41:27 -03:00
.gitignore fix: isolate PHP-pdftk dependency 2025-09-03 09:55:55 -03:00
.l10nignore fix: ignore vendor bin at transifex sync 2025-06-23 13:46:16 -03:00
.npmignore feat: add spdx 2024-10-26 16:41:27 -03:00
.php-cs-fixer.dist.php fix: isolate PHP-pdftk dependency 2025-09-03 09:55:55 -03:00
.prettierrc Merge branch 'signature-validate' into main 2021-04-26 12:33:03 -03:00
AUTHORS feat: add spdx headers 2024-10-26 14:57:54 -03:00
babel.config.js feat: add spdx headers 2024-10-26 14:57:54 -03:00
CHANGELOG.md chore: changelog 2025-09-02 15:53:28 -03:00
CODE_OF_CONDUCT.md feat: add spdx 2024-10-26 16:41:27 -03:00
composer.json fix: isolate PHP-pdftk dependency 2025-09-03 09:55:55 -03:00
composer.lock fix: isolate PHP-pdftk dependency 2025-09-03 09:55:55 -03:00
CONTRIBUTING.md chore: update contributing 2025-09-01 14:45:10 -03:00
COPYING fix: main license file 2025-04-16 14:54:15 -03:00
jsconfig.json 🧑‍💻 add missing prop 2022-08-04 20:36:33 -03:00
Makefile fix: makefile 2025-05-25 09:26:51 -03:00
openapi-administration.json fix: documentation 2025-04-17 15:30:12 -03:00
openapi-full.json fix: add pending API documentation 2025-08-12 13:55:26 -03:00
openapi.json fix: add pending API documentation 2025-08-12 13:55:26 -03:00
package-lock.json chore(deps): Bump sha.js from 2.4.11 to 2.4.12 2025-08-22 02:43:44 +00:00
package.json chore(deps-dev): Bump @babel/core from 7.27.4 to 7.27.7 2025-06-26 16:42:09 +00:00
psalm.xml fix: isolate PHP-pdftk dependency 2025-09-03 09:55:55 -03:00
README.md chore: update README.md - add Contributors section 2025-08-24 18:47:30 +05:30
rector.php fix: isolate PHP-pdftk dependency 2025-09-03 09:55:55 -03:00
redocly.yaml feat: add spdx headers 2024-10-26 14:57:54 -03:00
REUSE.toml chore: fix tests after move files 2025-05-21 09:34:40 -03:00
scoper.inc.php fix: isolate PHP-pdftk dependency 2025-09-03 09:55:55 -03:00
SECURITY.md feat: add spdx 2024-10-26 16:41:27 -03:00
stylelint.config.js feat: add spdx headers 2024-10-26 14:57:54 -03:00
tsconfig.json feat: rewrite file list 2024-11-05 16:20:22 -03:00
webpack.config.js chore: remove chunk all 2025-01-16 06:06:05 -03:00

Test Status Total Downloads Coverage Status REUSE status Start contributing

Nextcloud app to sign PDF documents.

Request a feature Report a BUG

Star History

Star History Chart

Contributing

There are many ways to contribute, including writing code, filing issues on GitHub, helping people Overflow, helping to triage, reproduce, or fix bugs that people have filed, adding to our documentation. To get more details go to our contributing guide.

Integrations

  • GLPI: Plugin to sign GLPI tickets
  • Approval: Approve/reject files based on workflows defined by admins

API Documentation

API Documentation

Contributors

Thanks go to these wonderful people: