编程语言
首页 > 编程语言> > PHP-作曲家在自定义路径中安装软件包或模块?

PHP-作曲家在自定义路径中安装软件包或模块?

作者:互联网

我尝试在特定路径下使用作曲家安装Drupal模块,

我检查了这些链接,但无法弄清楚.

请检查一下,并告诉我什么地方错了,我该怎么办?

我想要什么?

Install the Signature field module in the modules/patched directory.

这是与此问题相关的我的composer.json文件的一部分.

"require": {
    "composer/installers": "^1.0.24",
    "drupal/signature_field": "^1.0@RC",
},

    "installer-paths": {
        "core": ["type:drupal-core"],
        "modules/contrib/{$name}": ["type:drupal-module"],
        "profiles/contrib/{$name}": ["type:drupal-profile"],
        "themes/contrib/{$name}": ["type:drupal-theme"],
        "drush/contrib/{$name}": ["type:drupal-drush"],
        "modules/custom/{$name}": ["type:drupal-custom-module"],
        "themes/custom/{$name}": ["type:drupal-custom-theme"],
        "modules/patched/{$name}": ["type:drupal-patched-module"]
    },
    "patches": {
        "drupal/signature_field": {
            "Drupal Signature Field fix multi feilds": "modules/patched/signature_field/signature_field-2993223-08.patch"     
        }
    }
},

最后,我进行了composer的安装和composer的更新,但是模块没有转移到我想要的文件夹中

解决方法:

也许这可能会有所帮助(注意其他事项):

{
    "extra": {
        "installer-paths": {
            "modules/patched/{$name}": ["drupal/signature_field"],
            "modules/patched/{$name}": ["another/package"]
        }
    }
}

ReferenceGitHub comment

可能会这样:

{
    "extra": {
        "installer-paths": {
            "modules/patched/{$name}": ["drupal/signature_field"]
        }
    },
    "extra": {
        "installer-paths": {
            "modules/patched/{$name}": ["drupal/another_module"]
        }
    }
}

要么

{
    "extra": {
        "installer-paths": {
            "modules/patched/{$name}": ["drupal/signature_field"]
        },
        "installer-paths": {
            "modules/patched/{$name}": ["drupal/another_module"]
        }
    }
}

也,

You cannot use this to change the path of any package. This is only
applicable to packages that require composer/installers and use a
custom type that it handles.

您也可以按类型输入group包裹:

{
    "extra": {
        "installer-paths": {
            "your/custom/path/{$name}/": ["type:wordpress-plugin"]
        }
    }
}

或某些供应商:

{
    "extra": {
        "installer-paths": {
            "your/custom/path/{$name}/": ["vendor:drupal"]
        }
    }
}

标签:drupal-8,module,php
来源: https://codeday.me/bug/20191210/2105059.html