【问题标题】:composer place git repo to a custom path作曲家将 git repo 放置到自定义路径
【发布时间】:2016-06-10 06:14:16
【问题描述】:

如何将 git repo 放置到自定义路径?我正在使用作曲家/安装程序。我在 git repo 上开发了一个模块。我想将它添加到 composer.json 但在拉取它之后应该放置 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"]
    }
}

【问题讨论】:

    标签: php drupal composer-php


    【解决方案1】:

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

    {
        "name": "miteshmap/commerce",
        "type": "my-repo",
        "require": {
            "composer/installers": "~1.0"
        }
    }
    

    您的代码的其余部分看起来不错。

    【讨论】:

    • 看起来 OP 改变了他的问题
    • 也一样,只是换成了"web/modules/custom/{$name}": ["type:drupal-module"],
    猜你喜欢
    • 2016-12-05
    • 2016-12-09
    • 2019-09-08
    • 2018-01-22
    • 2017-10-17
    • 2016-12-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多