Php 编写器将git repo放置到自定义路径

Php 编写器将git repo放置到自定义路径,php,drupal,composer-php,Php,Drupal,Composer Php,如何将git回购放置到自定义路径?我正在使用composer/Installer。我开发了一个关于git回购的模块。我想将它添加到composer.json中,但在pull之后,它应该放在web/modules/custom目录中。我该怎么做呢 我在composer.json中添加了这些部分 "repositories": [ { "type": "vcs", "url": "https://github.com/miteshmap/axelerant_c

如何将git回购放置到自定义路径?我正在使用composer/Installer。我开发了一个关于git回购的模块。我想将它添加到composer.json中,但在pull之后,它应该放在web/modules/custom目录中。我该怎么做呢

我在composer.json中添加了这些部分

"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/miteshmap/axelerant_custom"
    }
],
"require": {
    "miteshmap/axelerant_custom": "*"
},
"extra": {
    "installer-paths": {
        "web/core": ["type:drupal-core"],
        "web/modules/contrib/{$name}": ["type:drupal-module"],
        "web/modules/custom/{$name}": ["type:drupal-module"],
        "web/profiles/contrib/{$name}": ["type:drupal-profile"],
        "web/themes/contrib/{$name}": ["type:drupal-theme"],
        "drush/contrib/{$name}": ["type:drupal-drush"]
    }
}

在github上的存储库中的
composer.json
文件中,您需要将名称编辑为
“miteshmap/commerce”
,将类型更改为您的规则
“web/modules/contrib/{$name}:[“type:drupal module”],
当前将其放置在该文件夹中,并且需要
“composer/installers”:“~1.0”


其余的代码看起来不错。

在github上的存储库中,在
composer.json
文件中,您需要将名称编辑为
“miteshmap/commerce”
,将类型更改为您的规则
“web/modules/contrib/{$name}”:[“type:drupal module”],
当前将其放在该文件夹中,并需要
“编写者/安装者”:“~1.0”


您的其余代码看起来很好。

看起来OP更改了他的问题它是一样的,只是替换了“web/modules/custom/{$name}”:[“type:drupal module”],看起来OP更改了他的问题它是一样的,只是替换了“web/modules/custom/{$name}”:[“type:drupal module”],
{
    "name": "miteshmap/commerce",
    "type": "my-repo",
    "require": {
        "composer/installers": "~1.0"
    }
}