szeidler/composer-patches-cli 问题修复 & 功能扩展

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

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

szeidler/composer-patches-cli

Composer 安装命令:

composer require szeidler/composer-patches-cli

包简介

README 文档

README

The Composer Patches CLI provides a simple CLI for cweagans/composer-patches.

Requirements

  • PHP 7.0 or greater
  • Composer

Installation

Add Composer Patches CLI as a composer dependency.

composer global require szeidler/composer-patches-cli:^1.0

Usage

Patch Enable

The patch enable function enables the patching functionality in your root composer.json. It will create empty patches definition in your composer.json or add a separate composer patch file, when using the --file option.

The patch enable command accepts the following options.

  • --file Filename of the composer patch file to be created

Example:

composer patch-enable --file='patches.json'  

Patch Add

composer patch-add <package> <description> <url> 

The patch add command accepts the following arguments in the defined order.

  1. <package> Name of the package to patch.
  2. <description> Description of the patch to be used.
  3. <url> URL or local path of the patch file.

Example:

composer patch-add drupal/core "SA-CORE-2018-002" "https://cgit.drupalcode.org/drupal/rawdiff/?h=8.5.x&id=5ac8738fa69df34a0635f0907d661b509ff9a28f"

The patch add command accepts the following options.

  • --no-update Use this option to prevent composer to update the package and apply the patch. The patch will only end up in your composer.json, not composer.lock file.

  • --no-dev Run the dependency update with the --no-dev option.

You can omit arguments for an interactive mode.

Patch Remove

composer patch-remove <package> <description>

The patch remove command accepts the following arguments in the defined order.

  1. <package> Name of the package from which you want to remove the patch.
  2. <description> Description of the patch to be removed.

Example:

composer patch-remove drupal/core "SA-CORE-2018-002"

You can omit arguments for an interactive mode.

Patch List

composer patch-list <package>

The patch add command accepts the following arguments.

  1. <package> (optional) Name of the package to patch.

If the package argument is omitted, the command will return all defined patches.

Example:

$ composer patch-list            

Package: drupal/core
+-----------------------------------------+-------------------------------------------------------------------------------------------------+
| Description                             | URL                                                                                             |
+-----------------------------------------+-------------------------------------------------------------------------------------------------+
| Simple decimals fail to pass validation | https://www.drupal.org/files/issues/2018-04-23/drupal_2230909_113.patch                         |
| SA-CORE-2018-002                        | https://cgit.drupalcode.org/drupal/rawdiff/?h=8.5.x&id=5ac8738fa69df34a0635f0907d661b509ff9a28f |
+-----------------------------------------+-------------------------------------------------------------------------------------------------+

Move remote patches to local files.

composer patch-remote-to-local <directory>

Using remote patches has security implications. Therefore it is wise to store them locally. This command will download all remote patches and store them in the given directory. The command will also update your composer.json or composer.patches.json.

The move remote patches to local files command accepts the following arguments.

  1. <directory> The name of the directory the files should be placed in.

Example:

composer patch-remote-to-local patches

Patch Migrate

composer patch-migrate-config

The patch migrate command migrates your Composer Patches 1 configuration to the Composer Patches 2 format. It handles the migration of patches, ignored patches, patch levels (converted to package depths).

After a successful migration, the command automatically runs patches-relock and patches-repatch to ensure your project is up-to-date with the new configuration.

Credits

Stephan Zeidler for Ramsalt Lab AS

License

The MIT License (MIT)

szeidler/composer-patches-cli 适用场景与选型建议

szeidler/composer-patches-cli 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 258.88k 次下载、GitHub Stars 达 28, 最近一次更新时间为 2018 年 04 月 24 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 szeidler/composer-patches-cli 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 258.88k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 28
  • 点击次数: 19
  • 依赖项目数: 5
  • 推荐数: 0

GitHub 信息

  • Stars: 28
  • Watchers: 2
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-24