composer 倉庫

創(chuàng)建一個空的代碼庫

composer init

初始本地代碼,根據(jù)提示完成操作:

1.This command will guide you through creating your composer.json config.` Package name (/) :

填寫包名(git地址中)

2.Description []:

包的描述信息

3.Author

作者信息

4.Minimum Stability []:

提示填寫最小穩(wěn)定版本,可輸入內(nèi)容為:stable, RC, beta, alpha, dev,穩(wěn)定性依次從左到右從大到小,越左邊越穩(wěn)定bug越少,自己測試的包就輸入:dev

5.Package Type (e.g. library, project, metapackage, composer-plugin)[]: library

提示填寫項目類型

6.License[]:MIT

提示填寫開源許可證

7.Would you like to define your dependencies (require) interactively [yes]?

提示是否需要設置依賴環(huán)境或者其他包

8.Search for a package:

提示搜索哪個依賴?依賴PHP,輸入php

9.Enter the version constraint to require (or leave blank to use the latest version):

需要哪個版本?

10.Add PSR-4 autoload mapping? laps namespace "Koala9527\Composerbuild"to the entered relative path. [src/, n to skip]:

是否添加PSR-4自動加載映射,

11.Do you confirm generation[yes]?

確認生成 yes

12.Would you like to install dependencies now [yes]?

是否先擇安裝依賴,

完成初始


composer dump-autoload 命令 自動加載類映射 生成配置



#打上標簽并加注釋

git tag -a "v1.0.1" -m "my first composer package"

#push標簽到遠程代碼倉庫,之后GitHub上就可以看到當前tag了

git push origin v1.0.1

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容