Manual:$wgExternalDiffEngine

This page is a translated version of the page Manual:$wgExternalDiffEngine and the translation is 59% complete.
Outdated translations are marked like this.
コンテンツ ハンドラーと記憶域: $wgExternalDiffEngine
使用する外部差分エンジンの名前。
導入されたバージョン:1.6.0 (r12987)
除去されたバージョン:使用中
許容される値:(文字列) または false
既定値:false

詳細

使用する外部差分エンジンの名前です。内部エンジンを使用するには false を設定します。

取りうる値:

  • false - 利用できる場合は wikidiff2 、それ以外は PHP 実装。
  • それ以外の文字列は外部差分の実行可能ファイルのパスとして扱われます。

The following values are no longer supported as of MW 1.32:

MediaWiki バージョン:
1.32
  • 'wikidiff2' - PHP/HHVM モジュールとして実装された、ウィキメディアの高速差分エンジン。

The following values are no longer supported as of MW 1.27:

MediaWiki バージョン:
1.27
  • 'wikidiff' および 'wikidiff3' - 後方互換性のため false として扱われます。

The external engine should return HTML for a table row containing four columns (two 'marker/content' pairs). These can be collapsed into one for diff formats that don't require columns, e.g. <tr><td colspan="4"></td></tr>

This setting replaces $wgUseExternalDiffEngine .

Example

To display diffs in the format of the common GNU diff program, it is necessary to wrap that executable in a small script such as the following. This is needed both to get the required HTML wrapper, and also because diff returns non-zero when inputs don't match (which they generally don't for wiki changes).

  • externaldiff.sh
    #!/bin/bash
    
    echo "<tr><td colspan=4><pre>"
    # @todo This should also escape HTML.
    diff "$1" "$2"
    DIFFRET=$?
    echo "</pre></td></tr>"
    
    if [[ $DIFFRET -eq 1 ]]; then
        exit 0
    else
        exit $DIFFRET
    fi
    
  • LocalSettings.php
    $wgDiffEngine = 'external';
    $wgExternalDiffEngine = '/path/to/externaldiff.sh';
    

関連項目