1
0
Fork 0

Update require docs, fixes #11823

pull/11895/head
Jordi Boggiano 2024-02-06 13:27:55 +01:00
parent 0f70c0a9c9
commit bff129f4f5
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 11 additions and 1 deletions

View File

@ -242,6 +242,9 @@ Specifying one of the words `mirrors`, `lock`, or `nothing` as an argument has t
The `require` command adds new packages to the `composer.json` file from The `require` command adds new packages to the `composer.json` file from
the current directory. If no file exists one will be created on the fly. the current directory. If no file exists one will be created on the fly.
If you do not specify a package, Composer will prompt you to search for a package, and given
results, provide a list of matches to require.
```shell ```shell
php composer.phar require php composer.phar require
``` ```
@ -256,7 +259,14 @@ to the command.
php composer.phar require "vendor/package:2.*" vendor/package2:dev-master php composer.phar require "vendor/package:2.*" vendor/package2:dev-master
``` ```
If you do not specify a package, Composer will prompt you to search for a package, and given results, provide a list of matches to require. If you do not specify a version constraint, composer will choose a suitable one based
on the available package versions.
```shell
php composer.phar require vendor/package vendor/package2
```
If you do not want to install the new dependencies immediately you can call it with --no-update
### Options ### Options