我正在尝试设置一个 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 关注
- 108 浏览
添加回答
举报
0/150
提交
取消