eaudeweb/heavy-lifter 问题修复 & 功能扩展

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

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

eaudeweb/heavy-lifter

Composer 安装命令:

composer require eaudeweb/heavy-lifter

包简介

Common commands for your Drupal project to get you up to speed

README 文档

README

Doing the heavy lifting for local Drupal development.

Installation

https://packagist.org/packages/eaudeweb/heavy-lifter

Drupal 8

  • Install the heavy-lifter with composer : composer require eaudeweb/heavy-lifter

  • Execute the configuration script for heavy-lifter : ./vendor/bin/robo site:config

  • Copy example.robo.yml to robo.yml, customize the username and password to the ones provided by system administrator

  • (Optional) You can add excluded drush commands to any of heavy-lifter's robo commands in robo.yml

Example :

site:
    update:
         excluded_commands:
           - locale:check
           - yyy
  • (Optional) You can add extra drush commands to any of heavy-lifter's robo commands in robo.yml

Example:

site:
    update:
         extra_commands:
           - locale:update
  • Execute ./vendor/bin/robo sql:sync to see if the installation successfully worked

Drupal 7

The installation guideline on Drupal 7 is the same as the one on Drupal 8, just a few observations are necessary:

  • Not all the available robo commands are available for Drupal 7 websites. (Some commands commit modifications available only to Drupal 8 websites and therefore have not been implemented/tested on Drupal 7)

How to use it inside a project

Note: You run all commands from the project's root folder (i.e. where you store the web/ folder).

  • Copy example.robo.yml to robo.yml and customize the username and password to the ones provided by system administrator

  • Get the database dump and import: ./vendor/bin/robo sql:sync

  • Update the site's configuration and database : ./vendor/bin/robo site:update

  • Get the files archive: ./vendor/bin/robo files:sync

  • Create archive with files directory to the given path : /vendor/bin/robo files:dump [destination]

  • Enable development: ./vendor/bin/robo site:develop

  • Download the database dump from the remote storage, without importing it : /vendor/bin/robo sql:download [destination]

Custom development scripts

If you want to run custom drush scripts at the end of the site:develop command, add these scripts in the PROJECT/etc/scripts/develop folder.

Database anonymize

  1. Run composer require eaudeweb/gdpr-dump
  2. Define your anonymize schema in an anonymize.schema.yml file, in the project root (in the same folder as robo.yml)
  3. Run ./vendor/bin/robo sql:dump --anonymize

Row values listed under ignored_values will not be anonymized.

anonymize.schema.yml example

users_field_data:
  name:
    formatter: email
    exclude: # the rows that have these values will NOT be anonymized
      uid: [1, 76, 228, 81, 116, 117, 149, 393]
  telephone:
    formatter: phoneNumber
  mail:
    formatter: email
    unique: true
    exclude:
      uid: [1, 76, 228, 81, 116, 117, 149, 393]
    conditions_action: ignore
  pass:
    formatter: password
  preferred_admin_langcode:
    formatter: clear
table2:
  column1:
    formatter: randomText
    include: # only the rows that have these values will be anonymized
      name: ['Name to anonymize']
  rand_num
    formatter: randomNumber
    arguments: [6] # argument passed to the randomNumber() function from the Faker library, max 6 digits
taxonomy_term_field_revision:
  name:
    formatter: company
    include: # you can also use SELECT queries to define your list of included rows. The select query MUST only select ONE column
      tid: SELECT tid FROM taxonomy_term_field_data WHERE vid = "partners"
...

Formatter types

  • name - generates a name
  • phoneNumber - generates a phone number
  • username - generates a random user name
  • password - generates a random password
  • email - generates a random email address
  • date - generates a date
  • longText - generates a sentence
  • number - generates a number
  • randomText - generates a sentence
  • text - generates a paragraph
  • uri - generates a URI
  • clear - generates an empty string

For more information about available formatters, check https://github.com/fzaninotto/Faker#formatters

Observations for Windows environment:

  • only command sql:dump is available
  • robo path is ./vendor/consolidation/robo/robo

Multisite

For multisites, create another key under sites in robo.yml and configure it similar to sites:default.

To run a command on a sub site, use the --site SITE argument.

Example:

robo.yml:

sites:
  default:
    ...
  subsite:
    ...

./vendor/bin/robo sql:sync --site subsite

eaudeweb/heavy-lifter 适用场景与选型建议

eaudeweb/heavy-lifter 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 56.31k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2018 年 11 月 21 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 eaudeweb/heavy-lifter 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 56.31k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 29
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 12
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2018-11-21