eq/diff 问题修复 & 功能扩展

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

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

eq/diff

Composer 安装命令:

composer create-project eq/diff

包简介

Utility for finding differences in configuration files

README 文档

README

Build Status Maintainability Test Coverage

Description

Utility for finding differences in configuration files.

Supported JSON and YAML files.

Installation

$ composer require eq/diff

Usage

$ ~/vendor/bin/gendiff -h
Generate diff

Usage:
  gendiff (-h|--help)
  gendiff [--format <fmt>] <firstFile> <secondFile>

Options:
  -h --help                     Show this screen
  --format <fmt>                Report format [default: pretty]

Pretty output:

$ ~/vendor/bin/gendiff first.json second.json
   {
       "common": {
           "setting1": "Value 1"
         - "setting2": "200"
           "setting3": true
         - "setting6": {
               "key": "value"
           }
         + "setting4": "blah blah"
         + "setting5": {
               "key5": "value5"
           }
       }
       "group1": {
         - "baz": "bas"
         + "baz": "bars"
           "foo": "bar"
       }
     - "group2": {
           "abc": "12345"
       }
     + "group3": {
           "fee": "100500"
       }
   }

Plain output:

$ ~/vendor/bin/gendiff --format plain first.json second.json
Property 'common.setting2' was removed
Property 'common.setting6' was removed
Property 'common.setting4' was added with value: 'blah blah'
Property 'common.setting5' was added with value: 'complex value'
Property 'group1.baz' was changed. From 'bas' to 'bars'
Property 'group2' was removed
Property 'group3' was added with value: 'complex value'

JSON output:

$ ~/vendor/bin/gendiff --format json first.json second.json
[{"key":"common","type":"nested","children":[{"key":"setting1","type":"unchanged","from":"Value 1","to":null},{"key":"setting2","type":"removed","from":"200","to":null},{"key":"setting3","type":"unchanged","from":true,"to":null},{"key":"setting6","type":"removed","from":{"key":"value"},"to":null},{"key":"setting4","type":"added","from":"blah blah","to":null},{"key":"setting5","type":"added","from":{"key5":"value5"},"to":null}]},{"key":"group1","type":"nested","children":[{"key":"baz","type":"changed","from":"bas","to":"bars"},{"key":"foo","type":"unchanged","from":"bar","to":null}]},{"key":"group2","type":"removed","from":{"abc":"12345"},"to":null},{"key":"group3","type":"added","from":{"fee":"100500"},"to":null}]

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-08-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固