介绍 composer 进阶命令

藏色散人
发布: 2021-03-30 17:27:14
转载
1759 人浏览过

下面由composer教程栏目带大家介绍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 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 进阶命令的详细内容。更多信息请关注PHP中文网其他相关文章!

相关标签:
来源:segmentfault.com
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!