Documentation Index
Fetch the complete documentation index at: https://docs.root.io/llms.txt
Use this file to discover all available pages before exploring further.
Beta. Composer support is actively maintained but may have rough edges. Report issues at github.com/rootio-avr/rootio_patcher.
pkg.root.io/composer/ as a Composer repository and consumed via the Root Patcher CLI, which rewrites your composer.json and runs composer update to apply the patches.
Prerequisites
The Root Patcher CLI (rootio_patcher) is required to analyze your dependencies and apply patches. Install it before configuring your project.
composer.lock must exist before running the patcher. If it is missing, run composer install first. The patcher reads exact resolved versions from the lock file to determine what is installed.How Composer patching works
The patcher uses pre-install patching:- Reads exact resolved versions from
composer.lock - Queries Root’s API for available patches
- Updates
composer.json— direct dependencies have their version constraint updated in place; transitive dependencies are explicitly pinned inrequire - Adds the Root Composer repository entry (
pkg.root.io/composer/) permanently tocomposer.json - Automatically runs
composer update --with-dependencies <affected-packages>to download patched versions and updatecomposer.lock
vendor/ directory is fully populated after the patcher runs — no separate install step needed.
Platform requirements (
php, ext-*) are not patched — they are managed by the OS, not Composer.Authentication
The patcher passes credentials to Composer via theCOMPOSER_AUTH environment variable. Set it before running the patcher with --dry-run=false:
Subsequent
composer install runs also require COMPOSER_AUTH. Once the patcher adds the pkg.root.io repository to composer.json, every future composer install in CI/CD needs this variable set so Composer can authenticate to fetch patched packages.Patching your project
1. Preview available patches
2. Apply patches
composer.json and composer.lock and populates vendor/.
3. Commit the changes
| Flag | Default | Description |
|---|---|---|
--dry-run | true | Preview changes without applying |
--file | composer.json | Path to the target composer.json |
CI/CD Configuration
GitHub Actions
composer install runs in other jobs or pipelines, set COMPOSER_AUTH as a repository secret and inject it into any step that runs Composer:
GitLab CI
Docker
composer install steps (e.g. in a multi-stage build) require COMPOSER_AUTH to authenticate with pkg.root.io.
Troubleshooting
| Issue | Solution |
|---|---|
composer.lock not found | Run composer install first to generate the lock file, then re-run the patcher |
file not found: composer.json | Run from your project root, or use --file=./path/to/composer.json |
composer update fails after patching | Ensure COMPOSER_AUTH is set with valid credentials for pkg.root.io |
Future composer install fails in CI/CD | Add COMPOSER_AUTH to your CI/CD secrets — the pkg.root.io repository entry is permanent in composer.json |
401 Unauthorized | Verify your API key is valid and that COMPOSER_AUTH is correctly formatted |