mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
[docs] wrap all lines to 80 chars
This commit is contained in:
parent
cabe1c2949
commit
c42e37037a
5 changed files with 304 additions and 112 deletions
|
@ -1,24 +1,32 @@
|
|||
# Command-line interface
|
||||
|
||||
You've already learned how to use the command-line interface to do some things. This chapter documents all the available commands.
|
||||
You've already learned how to use the command-line interface to do some
|
||||
things. This chapter documents all the available commands.
|
||||
|
||||
## init
|
||||
|
||||
In the [Libraries] chapter we looked at how to create a `composer.json` by hand. There is also an `init` command available that makes it a bit easier to do this.
|
||||
In the [Libraries] chapter we looked at how to create a `composer.json` by
|
||||
hand. There is also an `init` command available that makes it a bit easier to
|
||||
do this.
|
||||
|
||||
When you run the command it will interactively ask you to fill in the fields, while using some smart defaults.
|
||||
When you run the command it will interactively ask you to fill in the fields,
|
||||
while using some smart defaults.
|
||||
|
||||
$ php composer.phar init
|
||||
|
||||
## install
|
||||
|
||||
The `install` command reads the `composer.json` file from the current directory, resolves the dependencies, and installs them into `vendor`.
|
||||
The `install` command reads the `composer.json` file from the current
|
||||
directory, resolves the dependencies, and installs them into `vendor`.
|
||||
|
||||
$ php composer.phar install
|
||||
|
||||
If there is a `composer.lock` file in the current directory, it will use the exact versions from there instead of resolving them. This ensures that everyone using the library will get the same versions of the dependencies.
|
||||
If there is a `composer.lock` file in the current directory, it will use the
|
||||
exact versions from there instead of resolving them. This ensures that
|
||||
everyone using the library will get the same versions of the dependencies.
|
||||
|
||||
If there is no `composer.lock` file, composer will create one after dependency resolution.
|
||||
If there is no `composer.lock` file, composer will create one after dependency
|
||||
resolution.
|
||||
|
||||
### Options
|
||||
|
||||
|
@ -29,11 +37,13 @@ If there is no `composer.lock` file, composer will create one after dependency r
|
|||
|
||||
## update
|
||||
|
||||
In order to get the latest versions of the dependencies and to update the `composer.lock` file, you should use the `update` command.
|
||||
In order to get the latest versions of the dependencies and to update the
|
||||
`composer.lock` file, you should use the `update` command.
|
||||
|
||||
$ php composer.phar update
|
||||
|
||||
This will resolve all dependencies of the project and write the exact versions into `composer.lock`.
|
||||
This will resolve all dependencies of the project and write the exact versions
|
||||
into `composer.lock`.
|
||||
|
||||
### Options
|
||||
|
||||
|
@ -44,7 +54,9 @@ This will resolve all dependencies of the project and write the exact versions i
|
|||
|
||||
## search
|
||||
|
||||
The search command allows you to search through the current project's package repositories. Usually this will be just packagist. You simply pass it the terms you want to search for.
|
||||
The search command allows you to search through the current project's package
|
||||
repositories. Usually this will be just packagist. You simply pass it the
|
||||
terms you want to search for.
|
||||
|
||||
$ php composer.phar search monolog
|
||||
|
||||
|
@ -56,7 +68,8 @@ To list all of the available packages, you can use the `show` command.
|
|||
|
||||
$ php composer.phar show
|
||||
|
||||
If you want to see the details of a certain package, you can pass the package name.
|
||||
If you want to see the details of a certain package, you can pass the package
|
||||
name.
|
||||
|
||||
$ php composer.phar show monolog/monolog
|
||||
|
||||
|
@ -75,7 +88,8 @@ If you want to see the details of a certain package, you can pass the package na
|
|||
requires
|
||||
php >=5.3.0
|
||||
|
||||
You can even pass the package version, which will tell you the details of that specific version.
|
||||
You can even pass the package version, which will tell you the details of that
|
||||
specific version.
|
||||
|
||||
$ php composer.phar show monolog/monolog 1.0.2
|
||||
|
||||
|
@ -86,7 +100,9 @@ You can even pass the package version, which will tell you the details of that s
|
|||
|
||||
## depends
|
||||
|
||||
The `depends` command tells you which other packages depend on a certain package. You can specify which link types (`require`, `recommend`, `suggest`) should be included in the listing.
|
||||
The `depends` command tells you which other packages depend on a certain
|
||||
package. You can specify which link types (`require`, `recommend`, `suggest`)
|
||||
should be included in the listing.
|
||||
|
||||
$ php composer.phar depends --link-type=require monolog/monolog
|
||||
|
||||
|
@ -98,17 +114,21 @@ The `depends` command tells you which other packages depend on a certain package
|
|||
|
||||
### Options
|
||||
|
||||
* **--link-type:** The link types to match on, can be specified multiple times.
|
||||
* **--link-type:** The link types to match on, can be specified multiple
|
||||
times.
|
||||
|
||||
## validate
|
||||
|
||||
You should always run the `validate` command before you commit your `composer.json` file, and before you tag a release. It will check if your `composer.json` is valid.
|
||||
You should always run the `validate` command before you commit your
|
||||
`composer.json` file, and before you tag a release. It will check if your
|
||||
`composer.json` is valid.
|
||||
|
||||
$ php composer.phar validate
|
||||
|
||||
## self-update
|
||||
|
||||
To update composer itself to the latest version, just run the `self-update` command. It will replace your `composer.phar` with the latest version.
|
||||
To update composer itself to the latest version, just run the `self-update`
|
||||
command. It will replace your `composer.phar` with the latest version.
|
||||
|
||||
$ php composer.phar self-update
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue