我同时在开发两个作曲家软件包:一个将在我开发的其他软件包中使用的常规软件包,以及一个用于特定目的的特定软件包,需要该常规软件包才能工作。
现在,我的目录如下:
projects
|- general-package
| |- composer.json
| |- "other files"
|
|- specific-package
| |- composer.json
| |- "other files"
|
|- testing-directory
|- composer.json
|- "other files"
这是3个composer.json
文件:
{
"name": "vendor/general-package",
"require": {
"php": ">=7.0.0"
}
}
{
"name": "vendor/specific-package",
"require": {
"php": ">=7.0.0",
"vendor/general-package": "^1.0"
}
}
{
"config": {
"preferred-install": "source"
},
"repositories": [{
"type": "path",
"url": "../specific-package",
"options": {
"symlink": true
}
},
{
"type": "path",
"url": "../general-package",
"options": {
"symlink": true
}
},
],
"require": {
"php": ">=5.3.7",
"vendor/specific-package": "@dev",
"vendor/general-package": "@dev"
}
}
在测试目录中运行composer update
时,软件包vendor/specific-package
是从本地来源获取的,而vendor/general-package
是从packagist.org中获取的。
如何强制vendor/general-package
也要在本地获取?