前言
今天安装了node
,准备用npm
下载项目所需要的依赖包
由于本人英语不太好,在执行 composer init
命令后,凭借着经验知道需要输入什么信息,但还是不太明白,也了解软件人性化的地方,不输入肯定有默认值,果然一通回车后,居然 OK了,当时感觉真的应了网上说的那句话 “一通操作猛如虎,一看结果250”。
为了搞明白composer init
命令后需要输入那些信息,以及输入信息的规范,我在下午详细介绍一下:
composer init 命令详解
curl -sS https://getcomposer.org/installer | php
dduan@dduan:~/test_composer$ php composer.phar______/ ____/___ ____ ___ ____ ____ ________ _____/ / / __ \/ __ __ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_//_/
Composer version 1.8.6 2019-06-11 15:03:05
root@dduan:/home/dduan/test_composer
Do not run Composer as root/super user! See https://getcomposer.org/root for detailsWelcome to the Composer config generatorThis command will guide you through creating your composer.json config.
Package name (<vendor>/<name>) [root/test_composer]:yourname/projectname
Description []:这是一个测试composer init 项目Invalid author string. Must be in the format: John Smith <john&#64;example.com>
Author [, n to skip]: John Smith <john&#64;example.com>
Minimum Stability []:dev
Package Type (e.g. library, project, metapackage, composer-plugin) []:library
License []:Define your dependencies.
Would you like to define your dependencies (require) interactively [yes]?
Search for a package:php
Enter the version constraint to require (or leave blank to use the latest version): >&#61;5.4.0
Search for a package:
Would you like to define your dev dependencies (require-dev) interactively [yes]?{"name": "dduan/test_compser","description": "这是一个测试composer init 项目","type": "library","require": {"php": ">&#61;5.4.0"},"authors": [{"name": "John Smith","email": "john&#64;example.com"}],"minimum-stability": "dev"
}
Do you confirm generation [yes]?
Would you like to install dependencies now [yes]?
注意
composer init
和 npm init
命令后续操作类似 &#xff0c;npm init
也可以参照上文。