下面由composer教程栏目带大家介绍composer 进阶命令,希望对需要的朋友有所帮助!
composer 进阶命令
composer dumpautoload当更新了项目composer autoloader后。不要使用composer update去加载索引(update会更新整个项目),使用dumpautoload来完成。
支持一下两个参数
--optimize (-o)--no-dev
composer depends检测依赖关系 参考 https://docs.phpcomposer.com/03-cli.html#depends
composer show列出所有可用的软件包
$ composer showdoctrine/inflector 2.0.3 php doctrine inflector is a small library that can perform string manip...doctrine/instantiator 1.4.0 a small, lightweight utility to instantiate objects in php without invo...elasticsearch/elasticsearch v7.10.0 php client for elasticsearchezimuel/guzzlestreams 3.0.1 fork of guzzle/streams (abandoned) to be used with elasticsearch-phpezimuel/ringphp 1.1.2 fork of guzzle/ringphp (abandoned) to be used with elasticsearch-phpfilp/whoops 2.9.1 php error handling for cool kidsgraham-campbell/result-type v1.0.1 an implementation of the result typeilluminate/container v7.30.1 the illuminate container package.illuminate/contracts v7.30.1 the illuminate contracts package.illuminate/database v7.30.1 the illuminate database package.illuminate/support v7.30.1 the illuminate support package.
显示具体包的详细信息
$ composer show illuminate/databasename : illuminate/databasedescrip. : the illuminate database package.keywords : database, laravel, orm, sqlversions : * v7.30.1type : librarylicense : mit license (mit) (osi approved) https://spdx.org/licenses/mit.html#licensetextsource : [git] https://github.com/illuminate/database.git 13ae12f444c9d071c6867cf86afd2fdedfd081ecdist : [zip] https://api.github.com/repos/illuminate/database/zipball/13ae12f444c9d071c6867cf86afd2fdedfd081ec 13ae12f444c9d071c6867cf86afd2fdedfd081ecpath : e:\wamp\www\git\test\php\phptest\vendor\illuminate\databasenames : illuminate/databaseautoloadpsr-4illuminate\database\ => .requiresext-json *illuminate/container ^7.0illuminate/contracts ^7.0illuminate/support ^7.0php ^7.2.5|^8.0symfony/console ^5.0suggestsdoctrine/dbal required to rename columns and drop sqlite columns (^2.6).fakerphp/faker required to use the eloquent factory builder (^1.9.1).illuminate/console required to use the database commands (^7.0).illuminate/events required to use the observers with eloquent (^7.0).illuminate/filesystem required to use the migrations (^7.0).illuminate/pagination required to paginate the result set (^7.0).symfony/finder required to use eloquent model factories (^5.0).
composer包版本实例描述
1.0.2 指定包的确切版本(使用较少)
>=1.0或>=1.0,<2.0 范围表示 逗号,表示逻辑与&&的关系 管道符号 | 表示或的关系
1.0.* >=1.0 && < 1.1
~1.2.3 >=1.2.3,<1.3 (对于遵循语义化版本的项目很有用)
^1.2.3 >=1.2.3,<2.0.0
以上就是介绍 composer 进阶命令的详细内容。