用作曲家在不同路径上安装GIT包



我正在尝试使用Composer从自定义路径中安装GIT的存储库,因为我正在使用Bedrock进行WordPress。

在我的composer.json中,我有这个代码块:

// ...
repositories: [{
    "type": "package",
    "package": {
        "name": "juniorgarcia/acf-gme",
        "version": "1.0.2",
        "source": {
            "url": "https://github.com/juniorgarcia/acf-gme",
            "type": "git",
            "reference": "master"
        }
    }
}]
// ...
"extra": {
    "installer-paths": {
        "web/app/plugins/{$name}/": ["type:wordpress-plugin"]
    }
}

我的存储库的composer.json具有以下内容:

{
    "name": "juniorgarcia/acf-gme",
    "type": "wordpress-plugin",
    "description": "A extended version of ACF Google Maps plugin with some more functionality.",
    "require": {
        "composer/installers": "~1.0"
    },
    "extra": {
        "installer-name": "advanced-custom-fields-google-map-extended"
    }
}

我遵循作曲家的指示将其安装在自定义路径上,但不起作用。它安装在vendor上。我在做什么错?

分析 composer.lock后,我意识到,对于我的自定义存储库是这样的:

// ...
{
    "name": "juniorgarcia/acf-gme",
    "version": "1.0.2",
    "source": {
        "type": "git",
        "url": "https://github.com/juniorgarcia/acf-gme",
        "reference": "master"
    },
    "type": "library" // Notice here! Type is set to "library"
} // ...

类型设置为library,所以我在composer.json上添加了"type": "wordpress-plugin",这样:

{ // ...
  "type": "package",
  "package": {
    "name": "juniorgarcia/acf-gme",
    "version": "1.0.2",
    "type": "wordpress-plugin", // Here is where I changed.
    "source": {
      "url": "https://github.com/juniorgarcia/acf-gme",
      "type": "git",
      "reference": "master"
    }
  }
} // ...

这有效。我还更改了 installer-name添加此信息,例如:

// ... on my composer.json
"extra": {
    "installer-name": "advanced-custom-fields-google-maps-extended" // This also worked
 }

即使使用此功能,我也想知道为什么作曲家不读我的包裹的composer.json文件,这些文件已经具有typetype。Div>

相关内容

  • 没有找到相关文章

最新更新