Download the PHP package yetanotherape/diff-match-patch without Composer
On this page you can find all versions of the php package yetanotherape/diff-match-patch. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yetanotherape/diff-match-patch
More information about yetanotherape/diff-match-patch
Files in yetanotherape/diff-match-patch
Package diff-match-patch
Short Description Port of the google-diff-match-patch (https://github.com/google/diff-match-patch) lib to PHP
License Apache-2.0
Homepage https://github.com/yetanotherape/diff-match-patch
Informations about the package diff-match-patch
Diff-Match-Patch
The Diff Match and Patch libraries offer robust algorithms to perform the operations required for synchronizing plain text:
- computes character-based diff of two texts
- performs fuzzy match of given string
- applies a list of patches.
This is the port of Google's diff-match-patch library to PHP.
Diff
Compare two plain text and efficiently return a array of differences. It works with characters, but if you want to compute word-based or line-based diff — you can easily tune it for your needs.
Usage:
Returns:
Match
Given a search string, find its best fuzzy match in a plain text near the given location. Weighted for both accuracy and location.
Usage:
Patch
Apply a list of patches in Unidiff-like format onto plain text. Use best-effort to apply patch even when the underlying text doesn't match.
Usage:
Returns:
API
Currently this library available in:
- PHP
- C++
- C#
- Dart
- Java
- JavaScript
- Lua
- Objective-C
- Python
Regardless of language, each library uses the same API and the same functionality.
Algorithms
This library implements Myer's diff algorithm which is generally considered to be the best general-purpose diff. A layer of pre-diff speedups and post-diff cleanups surround the diff algorithm, improving both performance and output quality.
This library also implements a Bitap matching algorithm at the heart of a flexible matching and patching strategy.
Requirements
- PHP 7.3+
- Composer
Installation
License
Diff-Match-Patch is licensed under the Apache License 2.0 - see the LICENSE
file for details
All versions of diff-match-patch with dependencies
ext-iconv Version *
ext-json Version *
ext-mbstring Version *