这篇文章将为大家详细讲解有关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 show doctrine/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 Elasticsearch ezimuel/guzzlestreams 3.0.1 Fork of guzzle/streams (abandoned) to be used with elasticsearch-PHP ezimuel/ringPHP 1.1.2 Fork of guzzle/RingPHP (abandoned) to be used with elasticsearch-PHP filp/whoops 2.9.1 PHP error handling for cool kids graham-campbell/result-type v1.0.1 An Implementation Of The Result Type illuminate/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/database name : illuminate/database descrip. : The Illuminate Database package. keywords : database, laravel, orm, sql versions : * v7.30.1 type : library license : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText source : [git] https://github.com/illuminate/database.git 13ae12f444c9d071c6867cf86afd2fdedfd081ec dist : [zip] https://api.github.com/repos/illuminate/database/zipball/13ae12f444c9d071c6867cf86afd2fdedfd081ec 13ae12f444c9d071c6867cf86afd2fdedfd081ec path : E:\wamp\www\git\test\PHP\PHPtest\vendor\illuminate\database names : illuminate/database autoload psr-4 Illuminate\Database\ => . requires ext-json * illuminate/container ^7.0 illuminate/contracts ^7.0 illuminate/support ^7.0 PHP ^7.2.5|^8.0 symfony/console ^5.0 suggests doctrine/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进阶命令的示例分析”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。