承接 ixnode/php-branch-diagram-builder 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

ixnode/php-branch-diagram-builder

Composer 安装命令:

composer require ixnode/php-branch-diagram-builder

包简介

PHP Branch Diagram Builder

README 文档

README

PHP Latest Stable Version Total Downloads PHPStan PHPStan LICENSE

A library with which branching strategies can be made visible as an image through a config file and included in documentation files such as README.md.

Installation

$ composer require ixnode/php-branch-diagram-builder --dev

Usage

Create a file called .pbdb.yml with the following content:

title: Trunk Based Development
width: 1500
branches:
  - name: 'main'
    system: 'Productive system'
    color-light: '#0151ad'
    color-dark: '#024796'
  - name: 'development'
    system: 'Development system'
    color-light: '#01aaad'
    color-dark: '#029496'
  - name: ['feature', 1]
    system: 'Local development'
    color-light: '#70b964'
    color-dark: '#46733f'
  - name: ['feature', 2]
    system: 'Local development'
    color-light: '#f9a61b'
    color-dark: '#c48416'
  - name: ['feature', 3]
    system: 'Local development'
    color-light: '#ed1164'
    color-dark: '#b30c4c'
steps:
  - type: 'init'
    source: null
    target: 'main'
  - type: 'checkout'
    source: 'main'
    target: 'development'
  - type: 'checkout'
    source: 'development'
    target: ['feature', 1]
  - type: 'commit'
    source: ['feature', 1]
  - type: 'checkout'
    source: 'development'
    target: ['feature', 2]
  - type: 'commit'
    source: ['feature', 2]
  - type: 'merge'
    source: ['feature', 1]
    target: 'development'
  - type: 'checkout'
    source: 'development'
    target: 'main'
  - type: 'merge'
    source: 'development'
    target: ['feature', 2]
  - type: 'commit'
    source: ['feature', 2]
  - type: 'merge'
    source: ['feature', 2]
    target: 'development'
  - type: 'merge'
    source: 'development'
    target: 'main'
  - type: 'checkout'
    source: 'development'
    target: ['feature', 3]
  - type: 'commit'
    source: ['feature', 3]
  - type: 'merge'
    source: ['feature', 3]
    target: 'development'
  - type: 'merge'
    source: 'development'
    target: 'main'

Execute the following command:

$ vendor/bin/pbdb-builder build .pbdb.yml

It creates the following image:

Branching Strategy

This can be easily added to you README.md file:

![Branching Strategy](.phdb.png)

Development

Clone the app:

❯ git clone git@github.com:ixnode/php-branch-diagram-builder.git && \
  cd php-branch-diagram-builder

Composer install

❯ php -v
PHP 8.0.11 (cli) (built: Sep 23 2021 22:03:11) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.11, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.11, Copyright (c), by Zend Technologies
❯ composer -V
Composer version 2.1.9 2021-10-05 09:47:38
❯ composer install
...

Run tests

❯ composer test
Result
> phpunit tests --testdox
PHPUnit 9.5.10 by Sebastian Bergmann and contributors.

Branch (Ixnode\PHPBranchDiagramBuilder\Tests\Branch)
 ✔ Branch
 ✔ Branch name
 ✔ Branch title

Step (Ixnode\PHPBranchDiagramBuilder\Tests\Step)
 ✔ 1) Test StepTest class (unknown: NULL -> master).
 ✔ 2) Test StepTest class (init: master -> master).
 ✔ 3) Test StepTest class (init: NULL -> master).
 ✔ 4) Test StepTest class (checkout: NULL -> master).
 ✔ 5) Test StepTest class (checkout: master -> NULL).
 ✔ 6) Test StepTest class (checkout: master -> master).
 ✔ 7) Test StepTest class (checkout: master -> develop).
 ✔ 8) Test StepTest class (commit: NULL -> master).
 ✔ 9) Test StepTest class (commit: master -> NULL).
 ✔ 10) Test StepTest class (commit: master -> master).
 ✔ 11) Test StepTest class (commit: master -> develop).
 ✔ 12) Test StepTest class (merge: NULL -> master).
 ✔ 13) Test StepTest class (merge: develop -> NULL).
 ✔ 14) Test StepTest class (merge: develop -> develop).
 ✔ 15) Test StepTest class (merge: develop -> master).

Time: 00:00.015, Memory: 6.00 MB

OK (18 tests, 35 assertions)
> phpstan analyse --level 8 --memory-limit 256M src tests
 24/24 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 [OK] No errors

> vendor/bin/php-cs-fixer --dry-run --using-cache=no --rules=@PSR12 fix src
Loaded config default.

Checked all files in 0.262 seconds, 14.000 MB memory used
> vendor/bin/php-cs-fixer --dry-run --using-cache=no --rules=@PSR12 fix tests
Loaded config default.

Checked all files in 0.035 seconds, 12.000 MB memory used

Check the current version of the app:

# Git version
❯ git describe
v1.0.1

# VERSION file version
❯ cat VERSION
1.0.1

Change version

Increase the version number according to your needs: <MAJOR>.<MINOR>.<PATCH>

Name Description Command Parameter
MAJOR is increased when API incompatible changes are released. --major 1
MINOR is increased when new functionality that is compatible with the previous API is released. --minor 1
PATCH is increased when changes include API-compatible bug fixes only. --patch 1

Increase the version

# Show version
❯ cat VERSION
1.0.2

# Push changed VERSION file
❯ git add VERSION
❯ git commit -m "Add version $(cat VERSION)"
❯ git push

Tag the app (git)

# Tag and push new git tag
❯ git tag -a "v$(cat VERSION)" -m "version v$(cat VERSION)"
❯ git push origin "v$(cat VERSION)"

packagist.org

If you have connected your repository to packagist.org, check the result:

A. Authors

B. License

This tutorial is licensed under the MIT License - see the LICENSE.md file for details

C. Closing words

Have fun! :)

ixnode/php-branch-diagram-builder 适用场景与选型建议

ixnode/php-branch-diagram-builder 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.38k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2021 年 06 月 30 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 ixnode/php-branch-diagram-builder 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-06-30