定制 babymarkt/composer-cleaner-plugin 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

babymarkt/composer-cleaner-plugin

Composer 安装命令:

composer require babymarkt/composer-cleaner-plugin

包简介

A composer plugin to clean up your project directory

README 文档

README

Build Status Packagist PHP Version Support version GitHub GitHub All Releases

Install

To install the plugin use Composer:

composer require --dev babymarkt/composer-plugin-cleaner

Configure

The configuration must be placed in the extra section in composer.json. An example is:

{
  "name": "company/your-project",
  "type": "project",
  "extra": {
    "babymarkt:cleaner": {
      "context-name": {
        "pattern": [
          "README*",
          ".git*"
        ],
        "paths": [
          "test",
          "artifacts"
        ],
        "exclude": [
          "test/important"
        ]
      }
    }
  },
  "require-dev": {
    "babymarkt/composer-plugin-cleaner": "*"
  }
}

The program contains a default configuration under the context default (Surprise surprise!). More detailed information can be found in the class AbstractCommand. Run

composer babymarkt:cleaner:clean default

to use it.

Configuration options

context

Each configuration set is wrapped in a cleaning context. A context is a simple string which can be used on terminal to select the configuration.

{
  "extra": {
    "babymarkt:cleaner": {
      "context-name": {
        "your cleaner options": "..."
      }
    }
  }
}

pattern

pattern contains a list of glob pattern to select files in the project directory tree. Consult the PHP documentation or Wikipedia for more information about the glob function and patterns.

{
  "extra": {
    "babymarkt:cleaner": {
      "context-name": {
        "pattern": [
          "README*",
          ".git*"
        ]
      }
    }
  }
}

This example searches for files starting with README or .git in the complete project tree.

paths

By default the cleaner command use the project root directory to search files (the directory that contains the composer.json file). With the option paths you can set multiple paths to search for files in instead of the default root directory. All paths are relative to the root directory, also such starting with an /. Paths outside the root are being ommited.

{
  "extra": {
    "babymarkt:cleaner": {
      "context-name": {
        "pattern": [
          ".git*"
        ],
        "paths": [
          "src",
          "vendor"
        ]
      }
    }
  }
}

This example searches for files starting with .git in ./src and ./vendor, nowhere else.

exclude

This option allows you to exclude files from deletion. The list consists of RegEx patterns, without specifying the delimiter characters. The pattern is applied to the entire path and not only to the file name. The used delimiter character is the #. If you need to use it in you pattern, you must escape it.

{
  "extra": {
    "babymarkt:cleaner": {
      "context-name": {
        "pattern": [
          "data/*"
        ],
        "exclude": [
          ".*\\.important"
        ]
      }
    }
  }
}

This example searches for paths starting with data/ and NOT ends with .important.

Run

To run the command use composer:

composer babymarkt:cleaner:clean your-context-name

or add a custom script to your composer.json:

{
  "scripts": {
    "cleanup:dev": [
      "@composer babymarkt:cleaner:clean your-context-name"
    ]
  }
}

babymarkt/composer-cleaner-plugin 适用场景与选型建议

babymarkt/composer-cleaner-plugin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 2, 最近一次更新时间为 2020 年 09 月 23 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「plugin」 「composer」 「files」 「directories」 「cleanup」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 babymarkt/composer-cleaner-plugin 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-09-23