droath/drush-module-sync 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

droath/drush-module-sync

Composer 安装命令:

composer require droath/drush-module-sync

包简介

Sync Drupal modules based on a defined scope.

README 文档

README

Build Status

Sync Drupal modules based on a defined scope. Scopes are arbitrary but in most cases they're setup to match different environments, which are usually invoked based on different build processes that need to take place. The appropriate module(s) will be synced (installed/uninstalled) based on the scope definition that are defined in a YAML configuration.

Dependencies

  • Drush
  • Drupal 8

Similar Concept

Getting Started

First, you'll need to download the drush-module-sync library using composer:

composer require droath/drush-module-sync

Next, you need to create a module-sync configuration file. This can be done by executing the following command:

drush module-sync-generate

Once invoked, the command will prompt for input as it generates your module-sync.yml configuration. When adding scopes I usually input both local and stage, as those are common environments that require different modules to be installed or uninstalled. By default the module-sync.yml file will be generated in the Drupal site path, which is usually path-to-drupal/sites/default if you're not using a multi-site configuration.

You can set the save path to a different directory, by providing the --path option.

drush module-sync-generate --path=../configs

Now you can edit the module-sync.yml configuration that was generated. You can define different modules for each scope modules directive:

scope:
  stage:
    extend_base: true
    modules:
      - file_stage_proxy
  local:
    extend_base: true
    modules:
      - devel
      - file_stage_proxy
base:
  - field
  - views
  ...

As you can see the scope can extend from the base directive, as this is useful to remove module redundancy between multiple scopes. If you don't want to extend from the base, just set extend_base to false. Make sure to remove any modules from the base directive if you only want that module to be installed for a particular scope, which should already been defined.

Finally, after you've tweaked your module-sync configurations to your liking you can run the following command to execute the sync process.

drush module-sync --scope=local

Note: You can pass along the --yes|-y flag to confirm all prompts.

The command will evaluate what modules that have already been installed or need to be uninstalled for the given scope. Make sure you only run this command with the --yes flag when your certain all modules have been accounted for, as you could have undesired consequences.

droath/drush-module-sync 适用场景与选型建议

droath/drush-module-sync 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.82k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2017 年 05 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 droath/drush-module-sync 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 droath/drush-module-sync 我们能提供哪些服务?
定制开发 / 二次开发

基于 droath/drush-module-sync 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 2.82k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 9
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-05-06