Extension:Wikidiff2

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png
wikidiff2

Release status:Extension status stable

ImplementationTemplate:Extension#type PHP
DescriptionTemplate:Extension#description Faster diff plugin for MediaWiki under PHP and HHVM
Author(s)Template:Extension#username Tim Starling (Tim Starling (WMF)talk)
MediaWikiTemplate:Extension#mediawiki 1.6+
LicenseTemplate:Extension#license GNU General Public License 2.0 or later
Download https://releases.wikimedia.org/wikidiff2/
README

Translate the Wikidiff2 extension if it is available at translatewiki.net

Check usage and version matrix.

IssuesPhabricator

Open tasks · Report a bug

Wikidiff2 is a PHP and HHVM module that provides the external diff engine for MediaWiki. It is partly based on the original wikidiff, partly on DifferenceEngine.php. It performs word-level (space-delimited) diffs on general text, and character-level diffs on text composed of characters from the Japanese and Thai alphabets and the unified han; it includes support for Thai segmentation for word-level diffs in that language. Japanese, Chinese and Thai do not use spaces to separate words. The input is assumed to be UTF-8 encoded. Invalid UTF-8 may cause undesirable operation, such as truncation of the output, so the input should be validated by the application. The input text should have unix-style line endings.

The output is an HTML fragment -- a number of HTML table rows with the rest of the document structure omitted. The characters "<", ">" and "&" will be HTML-escaped in the output.

Installing[edit]

Debian GNU/Linux or Ubuntu[edit]

apt-get install php-wikidiff2

In your php.ini file, add:

extension = wikidiff2.so

If you are running a MediaWiki version older than 1.27 (newer versions automatically detect wikidiff2), add the following line to your LocalSettings.php file:

$wgExternalDiffEngine = 'wikidiff2';

Manually[edit]

First, get and compile libthai (it should be on your OS or distro's packages).

You can download wikidiff2 through git (git clone https://gerrit.wikimedia.org/r/p/mediawiki/php/wikidiff2.git) or by downloading a tarball from https://releases.wikimedia.org/wikidiff2/.

Then compile wikidiff2. You need phpize (shipped with PHP).

$ cd wikidiff2
$ phpize
$ ./configure
$ make
$ sudo make install

Make sure that your php option

extension = wikidiff2.so

is set. This is usually set in your php.ini file.

If you are running a MediaWiki version older than 1.27 (newer versions automatically detect wikidiff2), add the following line to your LocalSettings.php file:

$wgExternalDiffEngine = 'wikidiff2';