This Visual Studio Code plugin provides an interface to Composer dependency manager for PHP.
It also provides schema validation for composer.json
configuration files.
You must install Visual Studio Code and Composer on your system before you can use this plugin.
If Visual Studio Code is not installed, please follow the instructions here.
If Composer is not installed, please follow the instructions here.
- Open Visual Studio Code.
- Press
Ctrl+P
on Windows orCmd+P
on Mac to open the Quick Open dialog. - Type
ext install composer
to find the extension. - Press Enter or click the cloud icon to install it.
- Restart Visual Studio Code when prompted.
- Go to Visual Studio Code user settings and configure the composer.executablePath setting.
You can configure the following options by making changes to your user or workspace preferences.
[ Scope: Global | Optional | Default: true
]
Use this setting to enable or disable this plugin.
[ 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.
[ Scope: Global | Optional | Default: false
]
Use this setting to ignore all platform requirements (php, hhvm, lib-* and ext-*) and force the installation even if the local machine does not fulfill these.
[ Scope: Global | Optional | Default: true
]
Use this setting to defines whether the command is run in a terminal window or whether the output form the command is shown in the Output window. The default is to show the output in the terminal.
[ Scope: Global | Optional | Default: false
]
Use this setting to run composer commands with the --quiet
option.
[ 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"
}
All composer commands are available through the Command Pallet using F1
.
Display short information about composer.
Create an archive of this composer package.
Clears composer's internal package cache.
Displays detailed information about where a package is referenced.
Diagnoses the system to identify common errors.
Dumps the autoloader.
Discover how to help fund the maintenance of your dependencies.
The init command creates a basic composer.json file in the current directory.
Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.
Shows information about licenses of dependencies.
Shows a list of installed packages that have updates available, including their current and latest versions.
Displays detailed information about why a package cannot be installed.
Removes a package from the require or require-dev.
Adds required packages to your composer.json and installs them.
Run the scripts defined in composer.json.
Updates composer.phar to the latest version.
Show information about packages.
Show a list of locally modified packages.
Show a sorted list of suggested packages.
Updates your dependencies to the latest version according to composer.json, and updates the composer.lock file.
Validates a composer.json and composer.lock
Shows the composer version.
Displays detailed information about where a package is referenced.
Displays detailed information about why a package cannot be installed.
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.