PHP / Composer
Stout implements the Composer v2 repository protocol
(Packagist-compatible) with packages.json index and p2 metadata.
composer require works out of the box.
Configure Your Client
Add the Stout repository to your composer.json:
{
"repositories": [
{
"type": "composer",
"url": "https://registry.stout.io/php/myorg"
}
]
} Install a Package
composer require myvendor/my-package:1.2.0 Publish a Package
Stout builds from source. Submit a build via the API:
curl -X POST https://registry.stout.io/api/v1/builds \
-H "Authorization: Bearer $STOUT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"format": "php",
"repo": "https://github.com/myorg/my-package",
"version": "1.2.0"
}'
Your repository must include a composer.json at the root (or one level deep).
Authentication
For private packages, configure credentials in auth.json:
# auth.json
{
"http-basic": {
"registry.stout.io": {
"username": "token",
"password": "your-stout-token"
}
}
} Or via the CLI:
composer config http-basic.registry.stout.io token $STOUT_TOKEN Endpoints
| Method | Path | Description |
|---|---|---|
GET | /php/:owner/packages.json | Root package index (Composer v2) |
GET | /php/:owner/p2/*path | Package metadata |
GET | /php/:owner/dist/:vendor/:pkg/:file | Download package |