MediaWiki REL1_33
UnifiedDiffFormatter.php
Go to the documentation of this file.
1<?php
32
34 protected $leadingContextLines = 2;
35
37 protected $trailingContextLines = 2;
38
43 protected function lines( $lines, $prefix = ' ' ) {
44 foreach ( $lines as $line ) {
45 $this->writeOutput( "{$prefix}{$line}\n" );
46 }
47 }
48
52 protected function added( $lines ) {
53 $this->lines( $lines, '+' );
54 }
55
59 protected function deleted( $lines ) {
60 $this->lines( $lines, '-' );
61 }
62
67 protected function changed( $orig, $closing ) {
68 $this->deleted( $orig );
69 $this->added( $closing );
70 }
71
80 protected function blockHeader( $xbeg, $xlen, $ybeg, $ylen ) {
81 return "@@ -$xbeg,$xlen +$ybeg,$ylen @@";
82 }
83
84}
$line
Definition cdb.php:59
Base class for diff formatters.
writeOutput( $text)
Writes a string to the output buffer.
A formatter that outputs unified diffs.
blockHeader( $xbeg, $xlen, $ybeg, $ylen)
lines( $lines, $prefix=' ')
$lines
Definition router.php:61