看来你可以定义供应商dir为
something else(在你的情况下的插件):
{
"config": {
"vendor-dir": "plugins"
}
}
然后,您可以重命名包名称,使其在内部没有级别dir,例如:
"package": {
"name": "sfGuardPlugin",
所以,你的composer.json应该看起来像这样:
{
"config": {
"vendor-dir": "plugins"
},
"repositories": [
{
"type": "package",
"package": {
"name": "sfGuardPlugin",
"version": "4.0.2",
"dist": {
"url": "http://plugins.symfony-project.org/get/sfGuardPlugin/sfGuardPlugin-4.0.2.tgz",
"type": "tar"
}
}
}
],
"require": {
"sfGuardPlugin": "4.0.*"
}
}
编辑
使用这个配置,你会得到的路径(这当然不好symfony):
plugins/sfGuardPlugin/sfGuardPlugin-4.0.2/
我发现这个composer.json的解决方法:
{
"config": {
"vendor-dir": "plugins"
},
"repositories": [
{
"type": "package",
"package": {
"name": "sfGuardPlugin",
"version": "4.0.2",
"source": {
"url": "http://svn.symfony-project.com/plugins/sfGuardPlugin/",
"type": "svn",
"reference": "branches/1.3/"
}
}
}
],
"require": {
"sfGuardPlugin": "4.0.*"
}
}