Extension:Wikidiff2
|
wikidiff2 Release status: stable |
|
|---|---|
| Implementation | PHP |
| Description | Faster diff plugin for MediaWiki under PHP 5 |
| Author(s) | Tim Starling (Tim Starling (WMF)talk) |
| MediaWiki | 1.6+ |
| License | GNU General Public License 2.0 or later |
| Download | WMF diffusion repo - MWDJ README |
|
Translate the Wikidiff2 extension if it is available at translatewiki.net |
|
| Check usage and version matrix. | |
| 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]
UNIX[edit]
First, get and compile libthai (it should be on your OS or distro's packages).
Then, get and compile wikidiff2. You need phpize (shipped with PHP).
$ git clone https://gerrit.wikimedia.org/r/p/mediawiki/php/wikidiff2.git $ cd wikidiff2 $ phpize $ ./configure $ make $ sudo make install
Add the following line to your LocalSettings.php file:
$wgExternalDiffEngine = 'wikidiff2';
Make sure that your php option
extension = wikidiff2.so
is set. This is usually set in your php.ini file.
Debian GNU/Linux or its derivative[edit]
apt-get install php-wikidiff2
Add the following line to your LocalSettings.php file:
$wgExternalDiffEngine = 'wikidiff2';
In your php.ini file (/etc/php5/apache2/php.ini or /etc/php5/conf.d/wikidiff2.ini - any name you like), add:
extension = wikidiff2.so
Known problems[edit]
In older versions of the Debian package, if you have short_open_tag=Off in php.ini, you may see the following text at the top of every page when this extension is installed:
'Wikidiff2', 'version' => '', 'author' => 'Tim Starling', 'description' => 'external diff engine for MediaWiki', 'url' => 'https://www.mediawiki.org/wiki/Extension:Wikidiff2' ); $wgExternalDiffEngine = 'wikidiff2';
This happens due to short php open tags (<? instead of <?php).
Solutions:
- Change the
short_open_tagphp.ini directive toOn. - Manually edit the PHP files of this extension, changing
<?to<?php.
See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=716995
| This extension is being used on one or more Wikimedia projects. This probably means that the extension is stable and works well enough to be used by such high-traffic websites. Look for this extension's name in Wikimedia's CommonSettings.php and InitialiseSettings.php configuration files to see where it's installed. A full list of the extensions installed on a particular wiki can be seen on the wiki's Special:Version page. |