internal/dload
DLoad makes it easy to download and manage binary artifacts (RoadRunner, Temporal, custom tools) for PHP projects. Automate installs, lock versions across teams, handle cross-platform binaries, and keep artifacts out of VCS.
Install the package:
composer require internal/dload -W
This adds the vendor/bin/dload CLI tool to your project.
Initialize configuration (interactive mode):
./vendor/bin/dload init
This generates a dload.xml file in your project root with default tools (e.g., RoadRunner, Temporal).
First download:
./vendor/bin/dload get
This fetches all configured binaries/PHARs to your project root (or specified extract-path).
<!-- dload.xml -->
<dload>
<actions>
<download software="rr" version="^2025.1.0" />
</actions>
</dload>
Then run:
./vendor/bin/dload get
Verify with:
./rr --version
Add to composer.json to auto-download on composer install:
{
"scripts": {
"post-update-cmd": "dload get --no-interaction -v || echo 'Failed to download binaries'"
}
}
Why? Ensures CI/CD and local devs always have consistent tooling.
<!-- dload.xml -->
<dload>
<registry overwrite="false">
<software name="MyPharTool" alias="myphar" description="Custom PHAR tool">
<repository type="github" uri="myorg/myphar" asset-pattern="/^myphar\.phar$/" />
<binary name="myphar" pattern="/^.*\.phar$/" version-command="--version" />
</software>
</registry>
<actions>
<download software="myphar" type="phar" extract-path="./tools" />
</actions>
</dload>
Key Points:
type="phar" to skip extraction (PHARs are self-contained).extract-path isolates tools from project files.# .github/workflows/download.yml
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: composer install
- run: ./vendor/bin/dload get --no-interaction
- run: ./rr worker:start
Best Practices:
./runtime (DLoad’s temp dir) to avoid re-downloading.--no-interaction to skip prompts.<!-- dload.xml -->
<dload>
<actions>
<!-- Explicit OS/arch targeting -->
<download software="rr" arch="arm64" os="darwin" />
<download software="buf" arch="amd64" os="linux" />
</actions>
</dload>
Use Case: Force specific binaries for M1 Macs or ARM CI runners.
<download software="temporal"
version-path="composer.json@require.temporal/sdk"
version="^1.0.0" />
How It Works:
version-path to a Composer constraint (e.g., "temporal/sdk": "^1.0.0").version constraint.| Issue | Solution |
|---|---|
| Binary not found | Check asset-pattern in registry (Stage 2 troubleshooting). |
| Wrong OS/arch downloaded | Explicitly set arch/os or fix asset-pattern regex. |
| PHAR unpacked accidentally | Always use type="phar" for .phar files. |
| Permission denied | Run chmod +x ./rr or use --force in dload get. |
| CI fails silently | Add -v flag to dload get for verbose logs. |
./vendor/bin/dload software
./vendor/bin/dload get --dry-run
ls -la ./runtime/
xmllint --schema vendor/internal/dload/dload.xsd dload.xml
<registry overwrite="true">
<!-- Overrides built-in tools -->
<software name="rr" alias="rr" version="2025.1.0">
<repository uri="spatie/roadrunner" asset-pattern="/^roadrunner-.*/" />
</software>
</registry>
Use Case: Pin a specific fork of a tool.
<actions>
<velox config-file="./velox.toml"
binary-path="./bin/custom-rr"
debug="true" />
</actions>
Requirements:
velox.toml generated from roadrunner.dev/build.--cache to reuse downloaded assets.Add a new tool to the registry:
Edit vendor/internal/dload/src/Registry/SoftwareRegistry.php (not recommended for production).
Better: Use inline <registry> in dload.xml.
Custom download handlers:
Implement Dload\Contracts\DownloadHandler and bind it in a service provider.
How can I help you explore Laravel packages today?