Skip to content

[stable32] refactor(deps): move phpseclib to 3rdparty scoped vendor#7803

Merged
vitormattos merged 9 commits into
stable32from
backport/7801/stable32
Jun 18, 2026
Merged

[stable32] refactor(deps): move phpseclib to 3rdparty scoped vendor#7803
vitormattos merged 9 commits into
stable32from
backport/7801/stable32

Conversation

@backportbot-libresign

@backportbot-libresign backportbot-libresign Bot commented Jun 17, 2026

Copy link
Copy Markdown

Backport of #7801

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Amend HEAD commit to remove the line stating to skip CI

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

phpseclib/phpseclib is now provided by the 3rdparty scoped vendor bundle
(LibreSign/3rdparty) rather than as a direct Composer dependency.

Changes:
- Remove phpseclib/phpseclib from composer.json/composer.lock
- Remove phpseclib patcher from scoper.inc.php (now in 3rdparty)
- Update all namespace imports from 'phpseclib3\' to
  'OCA\Libresign\Vendor\phpseclib3\' in:
  - lib/Handler/SignEngine/TSA.php
  - lib/Handler/SignEngine/Pkcs12Handler.php
  - lib/Handler/CertificateEngine/AEngineHandler.php (inline FQCNs)
  - lib/Service/Install/SignSetupService.php
  - lib/Command/Developer/SignSetup.php
  - tests/php/Unit/Handler/SignEngine/TSATest.php

The 3rdparty update is tracked in LibreSign/3rdparty#65.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
twig, mpdf, and smalot/pdfparser were migrated to the scoped 3rdparty
vendor bundle. The libresign scoper only processes its local vendor/,
which no longer contains these packages. The patchers were dead code.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
The Playwright container (mcr.microsoft.com/playwright:v1.59.1-noble) does
not include libgd.so.3 or libc-client.so.2007e, causing PHP's gd and imap
extensions to fail on startup. This prevents occ maintenance:install from
running (Nextcloud requires GD).

Install the system libraries before setup-php and add imap to the PHP
extensions list.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Remove manual apt install of libgd3 and libc-client2007e.
shivammathur/setup-php installs system dependencies automatically
when extensions are listed — gd and imap are already declared.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
setup-php reports gd/imap as Enabled because the .so files are present
in the Playwright container, but does not install the underlying system
libraries (libgd3, libc-client2007e) that the .so files depend on.
Install them explicitly so PHP can actually load the extensions.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
All packages that required scoping (mpdf, twig, smalot/pdfparser,

phpseclib) have been migrated to the LibreSign/3rdparty bundle where

scoping is handled centrally.

libresign's local vendor/ now only contains jeidison/signer-php (used

directly with its own namespace) and psr/ (Nextcloud-provided).

lib/Vendor is never built, not tracked in git, and not referenced in

autoload. The scoper infrastructure is entirely dead code.

Remove scoper.inc.php and vendor-bin/php-scoper/.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>

[skip ci]
…ty submodule to stable32

- Remove phpseclib/phpseclib from composer.json require (now provided
  by the 3rdparty scoped bundle)
- Remove phpseclib/phpseclib from composer.lock
- Point 3rdparty submodule to stable32 (db8ab25a) which includes
  phpseclib/phpseclib 3.0.55 as a scoped dependency under PHP 8.1

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
The instanceof check was using the unscoped \phpseclib3\Crypt\Common\PrivateKey
but phpseclib is no longer a direct composer dependency on this branch.
Use the scoped OCA\Libresign\Vendor\phpseclib3 prefix to match how the
class is provided via the 3rdparty scoped vendor bundle.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos vitormattos marked this pull request as ready for review June 18, 2026 13:01
@vitormattos vitormattos merged commit 49415a8 into stable32 Jun 18, 2026
70 of 71 checks passed
@vitormattos vitormattos deleted the backport/7801/stable32 branch June 18, 2026 13:03
@github-project-automation github-project-automation Bot moved this from 0. Needs triage to 4. to release in Roadmap Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 4. to release

Development

Successfully merging this pull request may close these issues.

1 participant