druidfi/mona-plugin

此包已被废弃,不再维护。未建议替代包。

Mona Composer 插件,适用于 Drupal 7 网站站点

维护者

详细信息

github.com/druidfi/mona-plugin

源代码

安装次数: 19,441

依赖项: 1

建议者: 0

安全: 0

星级: 2

关注者: 4

分支: 8

类型:composer-plugin

2.0.2 2021-12-02 09:11 UTC

This package is auto-updated.

Last update: 2023-04-23 10:16:33 UTC


README

Tests

Composer 插件,用于创建基于 Composer 的 Drupal 7 安装时链接路径。

安装/更新

要安装/更新此组件的最新稳定版本,请打开控制台并执行以下命令

composer require druidfi/mona-plugin

注意!

如果您必须使用 Composer v1 和/或 PHP < 7.3,则可以要求 Mona 插件的 1.x 版本

composer require druidfi/mona-plugin:^1.4.0

包含

此插件还需要以下包

  • composer/installers:^2.0
  • cweagans/composer-patches:^1.7
  • drush/drush:^8.4

使用方法

配置

必须定义 Drupal 存储库

{
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/7"
        }
    ]
}

插件默认值(即如果您未重写,则不需要添加这些值)

{
    "extra": {
        "mona-plugin": {
            "composer-exit-on-patch-failure": true,
            "installer-paths": {
                "vendor/drupal": ["type:drupal-core"],
                "${webroot}/sites/all/libraries/{$name}": ["type:drupal-library"],
                "${webroot}/sites/all/modules/contrib/{$name}": ["type:drupal-module"],
                "${webroot}/sites/all/themes/{$name}": ["type:drupal-theme"],
                "${webroot}/sites/all/drush/{$name}": ["type:drupal-drush"]
            },
            "symlinks": {
            },
            "symlinks-force-create": false,
            "symlinks-skip-missing-target": false,
            "symlinks-absolute-path": false,
            "symlinks-throw-exception": true,
            "webroot": "public"
        }
    }
}

符号链接

创建指向 extra.mona-plugin.symlinks 部分的符号链接。

如果目标路径不存在,则将 symlinks-skip-missing-target 设置为 true,不要抛出异常如果应该不抛出异常如果目标路径不存在则将 symlinks-absolute-path 设置为 true,如果想要创建真实路径符号链接则将 symlinks-throw-exception 设置为 false,如果不想在某些错误时中断创建则将 symlinks-force-create 设置为强制删除已存在的链接路径上的链接

可以为任何符号链接设置个人配置。对于个人配置,必须定义 link

{
    "extra": {
        "mona-plugin": {
            "symlinks": {
                "vendor/woocommerce/flexslider": "public/sites/all/libraries/flexslider"
            },
            "symlinks-force-create": false,
            "symlinks-skip-missing-target": false,
            "symlinks-absolute-path": false,
            "symlinks-throw-exception": true
        }
    }
}

将库作为 Drupal 库添加

如果需要将库安装到 sites/all/libraries

如果它从 Packagist 中找到,则可以将其列为 Drupal 库

{
    "extra": {
        "mona-plugin": {
            "libraries": [
                "ckeditor/ckeditor"
            ]
        }
     }
}

或者可以定义自定义存储库

{
    "repositories": [
        {
            "type":"package",
            "package": {
                "name": "ckeditor/ckeditor",
                "version": "4.1.2",
                "dist": {
                    "type": "zip",
                    "url": "https://github.com/ckeditor/ckeditor-releases/archive/4.1.2/full.zip"
                },
                "type": "drupal-library"
            }
        }
    ]
}

开发

使用开发依赖项安装

composer install

运行 PHP CS Fixer

vendor/bin/php-cs-fixer fix src

从以下分支衍生

此插件基于 ComposerSymlinks 并修改为与 Drupal 7 基于 Composer 的安装一起使用。Mona Composer 插件以相同的许可证发布。

许可证

此组件受 MIT 许可证的保护。请参阅 LICENSE 文件中的完整许可证。