composer.json 常用配置解释
composer.json 常用的一些配置项详解
{
"name": "death_satan/test", //包名
"description": "testing", //包的介绍
"keywords": [
"test",
"demo"
], //包的关键字,在composer search时候或者在packagist.org搜索时用到
"type": "library", //包的类型,可选library,project,metapackage,composer-install
"homepage": "https://www.cnblogs.com/death-satan", //主页
"license": "MIT", //关于这个包的许可证信息
"authors": [ //二维数组,关于作者的一些信息
{
"name": "death-Satan",
"email": "death-satan@qq.com"
}
],
"require": {
"death_satan/demo": "^0.0.1", //包含某个包,:后面跟着是版本号
},
"require-dev": { //在开发环境下所需要包含进来的包
"death_satan/phpunit": "*",
},
"autoload": {
"files": [
"src/helpers.php"
], //自动加载的方法,在这里申明的文件会在程序启动前包含进来
"psr-4": {
"Death\\Satan\\Frame\\": "src/", //申明命名空间对应的文件路径
}
},
"autoload-dev": { //在开发环境下所申明的信息,比如phpunit的测试命名控件?
"files": [
"src/helpers.php"
], //自动加载的方法,在这里申明的文件会在程序启动前包含进来
"psr-4": {
"Death\\Satan\\Test\\Frame\\": "src/", //申明命名空间对应的文件路径
}
}
"suggest": {
"death_satan/demo": "应该安装这个包", //建议安装的包
},
"minimum-stability": "dev", //默认stable(稳定),可选dev,alpha,beta,RC
"repositories": [ //自定义的包资源库
{
"type": "path", //可选 path(本地路径),composer(私源),zip(zip文件),svn
"url": "上方所定义的对应地址"
}
],
"bin": [
"bin/shell"
], //自定义二进制文件
}
世人慌慌张张,不过图碎银几两