一、安装
1.1 linux
1 | curl -sS https://getcomposer.org/installer | php |
1.2 windows
1 | php -r "readfile('https://getcomposer.org/installer');" | php |
二、使用
2.1 修改源地址
2.1.1 修改全局
1 | composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ |
2.1.2 修改当前项目
1 | composer config repo.packagist composer https://mirrors.aliyun.com/composer/ |
2.2 常用命令
| 命令 | 作用 |
|---|---|
| composer require | 安装依赖包 |
| composer update | 更新依赖包 |
三、基于composer包
在composer.json中 autoload 中添加psr-4
示例如下
1 | "autoload": { |
1 | //app下Utooo文件夹下 Tel文件夹下 Supplier目录下 |