【windows】版
1.安裝composer,選擇PHP版本
https://getcomposer.org/Composer-Setup.exe
2.安裝git
https://objects.githubusercontent.com/github-production-release-asset-2e65be/23216272/2d1c35e2-ece0-4287-bc51-b221f43922b4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20240314%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240314T022228Z&X-Amz-Expires=300&X-Amz-Signature=5789cb0c2ba544dcb53f290ae2818fbff37278364c58f239f08ed60861d6d45a&X-Amz-SignedHeaders=host&actor_id=163369544&key_id=0&repo_id=23216272&response-content-disposition=attachment%3B%20filename%3DGit-2.44.0-64-bit.exe&response-content-type=application%2Foctet-stream
3.github上建立一個git倉庫
4.windows目錄上拉取倉庫,git colne https://github.com/wenli20230101/composer_t.git
5.composer init 初始化composer包
自動生成以下目錄
6.編輯業務程式碼放於src目錄內
7.git 提交程式碼到遠端
【二、主專案呼叫自己定義的包】
專案根目錄下,composer.json檔案內
新增
{
"authors": [
{
"name": "author",
"email": "author@qq.com"
}
],
"repositories": {
"1": {
"type": "vcs",
"url": "https://github.com/wenli20230101/composer_t.git"
},
"packagist": {
"type": "composer",
"url": "https://packagist.org",
"allow_ssl_downgrade": true
}
},
"require": {
"printlabel/print_common": "dev-main"
},
"autoload": {
"psr-4": {
"Elise\\": "./lib/Elise/",
"Monolog\\": "./app/helpers/Monolog/",
"APITest\\": ["tests/APITest"],
"": ["./app/"]
},
"files": [
"./lib/Elise/Util/tools.php"
],
"classmap": [
"tests/APITest"
]
},
"require-dev": {
"phpunit/phpunit": "^8",
"phpunit/php-invoker": "^2.0"
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "dev",
"prefer-stable": true
}