Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Composer CompanionNew to Visual Studio Code? Get it now.

Composer Companion

faelv

|
12,198 installs
| (2) | Free
Companion extension for Composer (a dependency manager for PHP) with easy access to scripts, tasks and common commands
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Composer Companion

Visual Studio Marketplace Version Visual Studio Marketplace Installs GitHub issues Travis (.com) branch

This is a companion extension for Composer, a dependency manager for PHP. Check out it's features below.

Features

Composer Scripts

Composer Scripts

Shows scripts in a dedicated view inside Explorer container, where you can easily run them or open their respective composer.json file.

Tasks

Tasks

Scripts can also be found as tasks in Terminal > Run Task / Run Build Task.

Easy access to Composer commands

Easy acces to Composer commands

Press Ctrl+Shift+P and start typing composer to see all the available commands. The necessary inputs or arguments can be conveniently picked from a menu.

Schema Validation

Validates and offer hints about the composer.json file structure.

Requirements

  • Composer, version 1.9.0 or higher recommended (https://getcomposer.org/download/)
  • PHP, version 5.3.2 or higher

Extension Settings

This extension contributes the following settings:

  • composerCompanion.enabled ( true | false ): If Composer Companion is enabled or not. It can be used in user, workspace and folder settings.
  • composerCompanion.executablePath ( string ): Path to the composer executable. It can be used in user and workspace settings; if not specified the extension will try to pick it automatically, otherwise you'll see a warning.
  • composerCompanion.showScriptsInExplorer ( true | false ): If Composer Companion should add a scripts view to the Explorer container. It's only available in the user settings.

Troubleshooting

- You see an "Open With" dialog in Windows:

In this case, using composer.bat instead of composer.phar is recommended.

If you don't have a composer.bat file you can create one in the same folder as composer.phar. Copy and paste the following content, then save:

@echo OFF
setlocal DISABLEDELAYEDEXPANSION
"php.exe" "%~dp0composer.phar" %*

You may need to adjust the php.exe location.

- You see an invalid executable path warning:

This means the extension didn't found Composer. Either provide the complete path in settings (composerCompanion.executablePath) or add it to your PATH environment variable. Also check if composer and PHP are both actually installed and your php.validate.executablePath setting is correct.

Support

If something isn't working open an issue here.

Third-Party Notices

  • Codicons icons used under a Creative Commons Attribution 4.0 International Public License, see the LICENSE file at https://github.com/microsoft/vscode-codicons/blob/master/LICENSE
  • Composer logo used under a MIT License, see the LICENSE file at https://github.com/composer/composer/blob/master/LICENSE
  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft