composer镜像
composer全局安装的命令路径 C:\Users\xxx\AppData\Roaming\Composer\vendor\bin1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107composer global require slince/composer-registry-manager
$ composer repo:ls
composer https://packagist.org
phpcomposer https://packagist.phpcomposer.com
composer-proxy https://packagist.composer-proxy.org
* laravel-china https://packagist.laravel-china.org
cnpkg https://php.cnpkg.org
composer repo:use laravel-china
composer require 安装的时候可能会把.git目录也下载了,因为木有php-zip扩展,所以使用的git clone 来下载,默认是wget
要列出所有已安装的包及其版本号和说明,只需使用 show:
composer show
有时候把这些信息用依赖关系树的形式查看会更容易理解, 可以通过 --tree or -t 参数:
composer show -t
如果要筛选返回的包,可以使用通配符传递一个额外的字符串参数 *:
composer show -t
acacha/admin-lte-template-laravel 1.0.5 AdminLTE template applied to Laravel Scaffolding
├──illuminate/console ~5.0
├──illuminate/support ~5.0
└──php >=5.4.0
baum/baum 1.1.1 Baum is an implementation of the Nested Set pattern for Eloquent models.
├──illuminate/console 5.*
├──illuminate/database 5.*
├──illuminate/events 5.*
├──illuminate/filesystem 5.*
├──illuminate/support 5.*
└──php >=5.4.0
cloudmario/scs dev-master PHP SDK for 新浪云存储
└──php >=5.2.0
firephp/firephp-core v0.4.0 Traditional FirePHPCore library for sending PHP variables to the browser.
guzzlehttp/guzzle 5.3.1 Guzzle is a PHP HTTP client library and framework for building RESTful web service clients
├──guzzlehttp/ringphp ^1.1
│ ├──guzzlehttp/streams ~3.0
│ │ └──php >=5.4.0
│ ├──php >=5.4.0
│ └──react/promise ~2.0
│ └──php >=5.4.0
└──php >=5.4.0
jenssegers/mongodb v2.1.9 A MongoDB based Eloquent model and Query builder for Laravel 4
├──illuminate/container ^5.0
├──illuminate/database ^5.0
├──illuminate/events ^5.0
├──illuminate/support ^5.0
└──php >=5.4.0
composer show 'symfony/*'
如果要查看有关特定包的信息,需要完整包名:
$ composer show laravel/framework
name : laravel/framework
descrip. : The Laravel Framework.
keywords : framework, laravel
versions : * v5.0.16
type : library
license : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText
source : [git] https://github.com/laravel/framework.git 861a1e78c84dca82fe4bd85d00349c52304eea77
dist : [zip] https://api.github.com/repos/laravel/framework/zipball/861a1e78c84dca82fe4bd85d00349c52304eea77 861a1e78c84dca82fe4bd85d00349c52304eea77
如果您想知道安装特定软件包的原因,可以使用 why 命令来确定哪些依赖项需要它:
composer why vlucas/phpdotenv
composer why vlucas/phpdotenv -t
使用 --verbose 或 -v 参数来查看本地修改的软件包和文件:
composer status -v
$ composer licenses
Name: laravel/laravel
Version: dev-dev_wzp
Licenses: MIT
Dependencies:
Name Version License
acacha/admin-lte-template-laravel 1.0.5 MIT
bacon/bacon-qr-code 1.0.1 BSD-2-Clause
baum/baum 1.1.1 MIT
classpreloader/classpreloader 1.2.0 MIT
cloudmario/scs dev-master 5294387 MIT
检测一下已安装的包,哪些有可以升级的。这可以使用 outdated 命令。
composer outdated
acacha/admin-lte-template-laravel 1.0.5 6.0
bacon/bacon-qr-code 1.0.1 2.0.0
classpreloader/classpreloader 1.2.0 3.2.0
cloudmario/scs dev-master 5294387 dev-master 4610269
danielstjules/stringy 1.9.0 3.1.0
doctrine/inflector v1.0.1 v1.3.0
doctrine/instantiator 1.0.5 1.2.0
evenement/evenement v2.0.0 v3.0.1
guzzlehttp/guzzle 5.3.1 6.3.3
guzzlehttp/psr7 1.3.1 1.5.2
Laravel 最近发布了一个新的 5.8 版本的框架;我们可以使用 why-not 命令检查任何阻止我们更新 laravel/framework 包的包:
composer why-not laravel/framework 5.8
如果您想知道安装特定软件包的原因,可以使用 why 命令来确定哪些依赖项需要它:
composer why vlucas/phpdotenv
laravel/framework v5.0.16 requires vlucas/phpdotenv (~1.0)
https://learnku.com/laravel/t/28678
多线程下载composer
1 | 国内源搭配多线程下载composer |
httpstat
1 | $ git clone https://github.com/talhasch/php-httpstat |
PHP 静态代码分析phan
1 | https://laravel-china.org/topics/19011 https://github.com/nunomaduro/larastan https://laravel-china.org/topics/20768 |
phpcs
命令行音乐搜索下载器
1 | $ composer global require guanguans/music-php |
phpmd
语法检测
1 | composer require overtrue/phplint --dev -vvv |
psysh
管理缓存
1 | https://learnku.com/articles/26314 |
php7cc语法检测
1 | //https://github.com/sstalle/php7cc/releases |
内网穿透spike
1 | composer global require slince/spike |
phpcbf
加速composer开启多线程安装下载
1 | $ composer global require hirak/prestissimo |
包构建工具package-builder
1 | // |
pecl
1 | pecl install swoole 默认是按照最新版的,如果有你的环境php不是最新,那需要按照PHP版本去安装 |
经纬度行政区域查询
1 |
|
格式化 SQL
1 | composer global require jdorn/sql-formatter |
将 PHP 应用快速打包为 PHAR
1 | composer require humbug/box |
phptrace
1 | wget https://github.com/Qihoo360/phptrace/archive/v1.0.1-beta.tar.gz |
gdb
1 | for ($i = 0; $i < 3; $i ++) { |
curl
1 | curl -x 123.45.67.89:1080 -o page.html http://www.yahoo.com 使用代理访问 |
代码检查工具
1 | composer require --dev bamarni/composer-bin-plugin |
格式化并高亮 SQL 语句
1 | composer global require jdorn/sql-formatter |
命令行翻译器
1 | 全局安装 |
镜像
1 | 腾讯 https://mirrors.cloud.tencent.com/composer/ |
一键生成 Composer/PHP/ThinkPHP/Laravel 扩展包
1 | composer g require huangdijia/composer-package-builder |
图片转字符
1 | composer require aizuyan/img2ascii |