我正在嘗試設置一個 Composer 項目,該項目將使我能夠設置自己的框架并提取存儲在 github 私有存儲庫中的任何給定依賴項。首先是一些先決條件:我不想向 packagist 添加代碼。我想確保我的供應商文件夾盡可能干凈。框架composer.json{ "name": "mycompany/myframework", "description": "YET another Framework", "type": "project", "repositories": [ { "type": "package", "package": { "name": "mycompany/system", "version": "0.0.2", "type": "library", "source": { "url": "https://github.com/mycompany/system.git", "type": "git", "reference": "master" } } } ], "require": { "mycompany/system": "0.0.2", "mnsami/composer-custom-directory-installer": "1.1.*" }, "license": "proprietary", "authors": [...], "extra":{ "installer-paths":{} }}mycompany/系統composer.json{ "name": "mycompany/system", "type": "library", "description": "utility belt xD"}PHP 中該類的代碼(來自 mycompany/sytem )具有以下結構:namespace MYCOMPANY;//this file name is called utils.php//adherence to PSR-4 is assumedclass utils {}我的目標是:我想告訴作曲家它應該創建以下結構:供應商\ MYCOMPANY \ utils.php(不是供應商\ mycompany \ system \ utils.php)稍后,我希望能夠添加更多這樣的存儲庫并將它們也存儲在 MYCOMPANY 下??蚣軐@此設置進行工作。自定義安裝由mnsami/composer-custom-directory-installer處理我想根據經驗,我應該將不同的包保留在它們自己的目錄中,但是,因為其他文件將具有不同的命名約定,所以不存在覆蓋的風險。編輯 這可以做到嗎?如果是這樣,怎么辦?
- 1 回答
- 0 關注
- 141 瀏覽
添加回答
舉報
0/150
提交
取消