composer自己创建组件
新建github项目 并拉取到本地
本地执行composer init 初始化
打开composer.json编辑配置
{
"name": "wangsitong/perfect-curl",
"description": "easy curl for requests",
"type": "library",
"authors": [
{
"name": "wangsitong",
"email": "512350703@qq.com"
}
],
"require": {
"php": "^5.6|^7.0"
},
"minimum-stability": "dev",
"license": "MIT",
"keywords": [
"curl",
"wangsitong",
"perfect-curl"
],
"autoload": {
"psr-4": {
"PerfectCURL\\": "src/"
}
}
}
composer install 添加自动加载
更新代码至github
使用github账号登录 https://packagist.org
点击submit
将你的项目的 github 地址 填到那个 input 中
点击check, 检测 composer.json 是否有误
异常处理:
Warning from https://mirrors.aliyun.com/composer: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See
或者提示找不到对应版本
composer self-update新包只支持composer2.0
https://github.com/wang-sitong/perfect-curl
https://packagist.org/packages/wangsitong/perfect-curl
composer require wangsitong/perfect-curl
- 上一篇: Mac计划任务不执行的问题(系统权限)Python
- 下一篇: php传值传引用区别与示例