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

Composer

Ioannis Kappas

|
129,884 installs
| (3) | Free
PHP Composer for Visual Studio Code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

vscode-composer

Current Version Install Count Open Issues

This Visual Studio Code plugin provides an interface to Composer dependency manager for PHP. It also provides schema validation for composer.json configuration files.

Installation

You must install Visual Studio Code and Composer on your system before you can use this plugin.

Visual Studio Code Installation

If Visual Studio Code is not installed, please follow the instructions here.

Composer Installation

If Composer is not installed, please follow the instructions here.

Plugin Installation

  1. Open Visual Studio Code.
  2. Press Ctrl+P on Windows or Cmd+P on Mac to open the Quick Open dialog.
  3. Type ext install composer to find the extension.
  4. Press Enter or click the cloud icon to install it.
  5. Restart Visual Studio Code when prompted.
  6. Go to Visual Studio Code user settings and configure the composer.executablePath setting.

Configuration

You can configure the following options by making changes to your user or workspace preferences.

composer.enabled

[ Scope: Global | Optional | Default: true ]

Use this setting to enable or disable this plugin.

composer.executablePath

[ Scope: Global | Required ]

Use this setting to specify the absolute path to the composer executable on your system.

Example user settings.json on Mac/Linux:

{
    "composer.executablePath": "/usr/local/bin/composer"
}

Example user settings.json on Windows:

{
    "composer.executablePath": "C:\\ProgramData\\ComposerSetup\\bin\\composer.bat"
}

Important: You will be unable to use this plugin unless you configure this setting before first use.

composer.workingPath

[ Scope: Workspace | Optional | Default: null ]

Use this setting to specify the absolute or workspace relative path to your composer.json. If not specified the workspace root path is used as default.

Example user settings.json on Mac/Linux:

{
    "composer.workingPath": "/projects/project-root/project-sub-folder"
}

Example user settings.json on Windows:

{
    "composer.workingPath": "C:\\Projects\\ProjectRoot\\ProjectSubFolder"
}

Usage

All composer commands are available through the Command Pallet using F1.

Supported Commands

Composer: About

Display short information about composer.

Composer: Archive

Create an archive of this composer package.

Composer: Clear Cache

Clears composer's internal package cache.

Composer: Diagnose

Diagnoses the system to identify common errors.

Composer: Dump Autoloader

Dumps the autoloader.

Composer: Install

Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.

Composer: Remove

Removes a package from the require or require-dev.

Composer: Require

Adds required packages to your composer.json and installs them.

Composer: Run Script

Run the scripts defined in composer.json.

Composer: Self Update

Updates composer.phar to the latest version.

Composer: Show

Show information about packages.

Composer: Status

Show a list of locally modified packages.

Composer: Update

Updates your dependencies to the latest version according to composer.json, and updates the composer.lock file.

Composer: Validate

Validates a composer.json and composer.lock

Composer: Version

Shows the composer version.

Contributing and Licensing

The project is hosted on GitHub where you can report issues, fork the project and submit pull requests.

The project is available under MIT license, which allows modification and redistribution for both commercial and non-commercial purposes.

  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2019 Microsoft