composer.json文件 | |
{ | |
“name”: “laravel/laravel”, | //项目名称 |
“description”: “The Laravel Framework.”, | //描述 |
“keywords”: [“framework”, “laravel”], | //关键词 |
“license”: “MIT”, | //许可协议 |
“type”: “project”, | //类型 |
“require”: { | |
“php”: “>=5.5.9”, | //PHP版本 |
“laravel/framework”: “5.2.*” | //框架版本 |
}, | |
“require-dev”: { | //依赖包 |
“fzaninotto/faker”: “~1.4”, | |
“mockery/mockery”: “0.9.*”, | |
“phpunit/phpunit”: “~4.0”, | |
“symfony/css-selector”: “2.8.*|3.0.*”, | |
“symfony/dom-crawler”: “2.8.*|3.0.*” | |
}, | |
“autoload”: { | //自动加载 |
“classmap”: [ | |
“database” | |
], | |
“psr-4”: { | //一种自动加载的规范 |
“App\\”: “app/” | |
} | |
}, | |
“autoload-dev”: { | //加载测试 |
“classmap”: [ | |
“tests/TestCase.php” | |
] | |
}, | |
“scripts”: { | //执行脚本 |
“post-root-package-install”: [ | |
“php -r \”copy(‘.env.example’, ‘.env’);\”” | |
], | |
“post-create-project-cmd”: [ | |
“php artisan key:generate” | |
], | |
“post-install-cmd”: [ | |
“php artisan clear-compiled”, | |
“php artisan optimize” | |
], | |
“post-update-cmd”: [ | |
“php artisan clear-compiled”, | |
“php artisan optimize” | |
] | |
}, | |
“config”: { | //配置项 |
“preferred-install”: “dist” | //优先安装压缩版 |
}, | |
“repositories”: { | //配置composer镜像 |
“packagist”: { | |
“type”: “composer”, | |
“url”: “https://packagist.phpcomposer.com” | |
} | |
} | |
} |