Compose This
Why Compose This?PHP projects often need to update specific packages with environment variables set beforehand and platform requirement flags appended. Running these commands manually every time is error-prone and slow. Compose This lets you save these commands as named tasks and run them in one click. Before:
After: Right-click Features
Screenshots1 — Right-click
|
| Field | Description | Example |
|---|---|---|
| Task Name | Label shown in the context menu | Update Logger Packages |
| Packages | vendor/package entries to pass to composer update. Leave empty to update all. |
monolog/monolog, vendor/core |
| Prefix Commands | Commands or env var assignments that run before composer, separated by ; |
$env:OTEL_PHP_AUTOLOAD_ENABLED="false" |
| Postfix Flags | Flags appended after the composer command | --ignore-platform-req=ext-ftp |
Generated command format
<prefix commands>; composer update <packages> <postfix flags>
Example output:
$env:OTEL_PHP_AUTOLOAD_ENABLED="false"; composer update monolog/monolog vendor/core --ignore-platform-req=ext-ftp --ignore-platform-req=ext-opentelemetry
Advanced: Edit tasks in settings.json
Tasks are stored in your VS Code global settings under composeThis.tasks. You can edit them directly:
- Open Command Palette → Preferences: Open User Settings (JSON)
- Add or edit the
composeThis.tasksarray:
"composeThis.tasks": [
{
"name": "Update Logger Packages",
"packages": ["monolog/monolog", "vendor/core"],
"prefixCommands": "$env:OTEL_PHP_AUTOLOAD_ENABLED=\"false\"",
"postfixCommands": "--ignore-platform-req=ext-ftp --ignore-platform-req=ext-opentelemetry"
},
{
"name": "Full Update",
"packages": [],
"prefixCommands": "",
"postfixCommands": "--no-plugins"
}
]
Requirements
- PHP installed and available in your terminal's
PATH - Composer installed globally (
composercommand available)
Extension Settings
| Setting | Type | Default | Description |
|---|---|---|---|
composeThis.tasks |
array |
[] |
List of named composer tasks. Use the visual settings panel or edit the JSON directly. |
Tips
- No tasks configured? Clicking "Compose This" will prompt you to open the settings panel.
- Multiple projects? Tasks are saved globally (per user) and work across all workspaces.
- Prefix on Windows — use PowerShell syntax for env vars:
$env:MY_VAR="value" - Prefix on Mac/Linux — use shell syntax:
MY_VAR=valueorexport MY_VAR=value
Contributing
Issues and pull requests are welcome at the GitHub repository.
License
MIT © Compose This


