定制 snebes/php-daisydiff 二次开发

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

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

snebes/php-daisydiff

最新稳定版本:v1.0.0

Composer 安装命令:

composer require snebes/php-daisydiff

包简介

PHP DaisyDiff Port

README 文档

README

PHP Version Latest Version Build Status Code Quality Test Coverage

Daisy Diff is a PHP implementation of the Java library that diffs (compares) HTML files. It highlights added and removed words and annotates changes to the styling.

Installation

You can add this library as a local, per-project dependency to your project using Composer:

composer require snebes/php-daisydiff

Usage

The DaisyDiff class can be used to generate a textual representation of the difference between two HTML strings:

<?php

use SN\DaisyDiff\DaisyDiff;

$original = '<html><body>The original document</body></html>';
$modified = '<html><body>The changed document</body></html>';

$daisyDiff = new DaisyDiff();
\printf("%s\n", $daisyDiff->diff($original, $modified));

The code above yields the output below:

<html>The <del class="diff-html-removed">original </del><ins class="diff-html-added">changed </ins>document</html>

Thanks

Many thanks to:

  • Java DaisyDiff, the original Java version of the DaisyDiff library.
  • gdevanla/assist from which many of the tests of this library are extracted.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-01-30