定制 wannabe-pro/composer-release-plugin 二次开发

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

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

wannabe-pro/composer-release-plugin

Composer 安装命令:

composer require wannabe-pro/composer-release-plugin

包简介

Composer package release builder tool

README 文档

README

Composer plugin that allows generate and update builds witch package.

When installed, this plugin will look for a "build-plugin" ("build-plugin" for "-dev" mode) key in the composer configuration's "extra" section. The value for this key is a set of options configuring the plugin.

Configuration value is named list of build targets names. For every name specified:

  • "builder" - the builder class name, it's required attribute of building configuration;
  • "composer" - the composer package json for specific build, this may be a file name in package or infile-fragment;
  • "map" - the rules set for file mapping in build target.

Plugin duplicate composer install and update actions for shadow copy of package on virtual path used specific composer package of build if is set. After that action plugin map files in virtual patch and give it iterator for specified builder by name.

{
    "require": {
        "wanna-be-pro/composer-release": "*"
    },
    "extra": {
        "build-plugin": {
            "ProductionBuildTargetName": {
                "builder": "SpecificBuilderName",
                "composer": "SpecificComposerPackage",
                "mapper": "SpecificFilesMapRules"
            }
        },
        "build-plugin-dev": {
            "DevelopmentBuildTargetName": {
                "builder": "SpecificBuilderName",
                "composer": "SpecificComposerJson",
                "mapper": "SpecificFilesMapRules"
            }
        }
    }
}

Mapper rule check source file relative path and apply template name for it. If template name not set or false then its exclude file from release. By default template name equivalent source and all files will be excluded if not otherwise.

{
    "/^README.md/": true,
    "/(.*)\\.php$/": "$1.inc",
    "/(^|\\/)\\./": false
}

This package preset builder named copy for simple copy files. All builders will extend WannaBePro\Composer\Plugin\Release\Builder and registered by WannaBePro\Composer\Plugin\Release\Plugin::addBuilder($name, $builder) in composer-plugin.

Mapper allow external rules file to manipulate of targets. Set mapper key as numeric value and napper value as source file name. This rule file accept TargetIterator as $iterator var. You may append iterator of new targets for builder as $iterator->getInnerIterator()->append(). Use FiltredFile as items for disable another filtration rules on this files.

Mapper rules allow config object to setup stream options.

{
    "/^.*\\.php$/": {
        "result": "/cp1251/$0",
        "config": {
            "context": {
                "proxy": "tcp://squid.example.com:8000"
            },
            "filters": ["convert.iconv.utf-8.cp1251"]
        }
    }
}

Configuration of context and filters by default apply for build source stream.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-05-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固