Scoped 3rd party libraries that are necessary to run the LibreSign Nextcloud app.
This repository contains vendor dependencies processed with PHP-Scoper to avoid conflicts with Nextcloud core and other apps. All classes are prefixed with OCA\Libresign\Vendor\
.
The LibreSign 3rdparty repository has a different structure compared to Nextcloud's 3rdparty:
- Scoped dependencies: Located in
composer/
directory (not root) - Source dependencies: Located in
vendor/
directory - Scoper configuration: Uses
scoper.inc.php
to apply namespace transformations - Automatic processing: PHP-Scoper runs automatically via composer scripts
- Make sure to use the latest version of composer:
composer self-update
- Edit composer.json and adjust the version of the library to the one to update to. Pay attention to use the full version number (i.e. ^5.3.14).
- Run
composer update thevendor/thelib
(replace accordingly) - Delete all installed dependencies with
rm -rf ./composer/*/ ./vendor/*/
- Run
composer install --no-dev
- This automatically runs PHP-Scoper via post-install-cmd script
- Scoped dependencies are generated in
composer/
directory
- Run
git clean -X -d -f
- Run
composer dump-autoload
- Commit all changes onto a new branch
- You might need the following command for pushing if used as submodule:
git push [email protected]:libresign/3rdparty.git branchname
This repository uses PHP-Scoper to avoid namespace conflicts with Nextcloud core and other apps:
- Namespace prefix:
OCA\Libresign\Vendor\
- Configuration: See
scoper.inc.php
for scoping rules and patchers - Output directory:
composer/
(configured in scoper.inc.php) - Automatic execution: Runs via composer post-install-cmd and post-update-cmd scripts
The scoper.inc.php
file includes specific patchers for:
- Twig: Handles template compilation and function calls
- Mpdf: Manages PDF generation library scoping
- phpseclib: Cryptographic library adjustments
- pdfparser: PDF parsing functionality
If you need to run PHP-Scoper manually:
# Install scoper dependencies first
composer bin all install --ansi
# Run scoper manually
php -d error_reporting=E_ALL\&~E_DEPRECATED\&~E_USER_DEPRECATED \
vendor-bin/php-scoper/vendor/humbug/php-scoper/bin/php-scoper add-prefix --force
# Regenerate autoload
composer dump-autoload -o
- On https://github.com/libresign/libresign make a new branch
3rdparty/my-dependency
- Navigate into the 3rdparty directory
- Checkout the commit sha of the last commit of your PR in the 3rdparty repository
- Leave the directory
- Add the change to the stash
- Commit (with sign-off and message)
- Push the branch and send a PR
- β³ Wait for CI and reviews
- Navigate into the 3rdparty directory
- Checkout the commit sha of the merge commit of your PR in the 3rdparty repository
- Leave the directory
- Add the change to the stash
- Amend to the previous dependency bump
- Push with lease force
- β³ Wait for CI
- Merge π
cd 3rdparty
git checkout 16cd747ebb8ab4d746193416aa2448c8114d5084
cd ..
git add 3rdparty
git commit
git push origin 3rdparty/my-dependency
# Wait for CI and reviews
cd 3rdparty
git checkout 54b63cc87af3ddb0ddfa331f20ecba5fcc01d495
cd ..
git add 3rdparty
git commit --amend
git push --force-with-lease origin 3rdparty/my-dependency