74 foreach ( $diff->edits as $edit ) {
75 if ( $edit->type ==
'copy' ) {
76 if ( is_array( $block ) ) {
77 if ( count( $edit->orig ) <= $nlead + $ntrail ) {
81 $context = array_slice( $edit->orig, 0, $ntrail );
84 $this->
block( $x0, $ntrail + $xi - $x0,
85 $y0, $ntrail + $yi - $y0,
90 $context = $edit->orig;
92 if ( !is_array( $block ) ) {
93 $context = array_slice( $context, count( $context ) - $nlead );
94 $x0 = $xi - count( $context );
95 $y0 = $yi - count( $context );
105 $xi += count( $edit->orig );
107 if ( $edit->closing ) {
108 $yi += count( $edit->closing );
112 if ( is_array( $block ) ) {
113 $this->
block( $x0, $xi - $x0,
132 protected function block( $xbeg, $xlen, $ybeg, $ylen, &$edits ) {
134 foreach ( $edits as $edit ) {
135 if ( $edit->type ==
'copy' ) {
137 } elseif ( $edit->type ==
'add' ) {
138 $this->
added( $edit->closing );
139 } elseif ( $edit->type ==
'delete' ) {
141 } elseif ( $edit->type ==
'change' ) {
142 $this->
changed( $edit->orig, $edit->closing );
144 throw new MWException(
"Unknown edit type: {$edit->type}" );
160 $this->result .= $text;
167 $val = $this->result;
183 $xbeg .=
',' . ( $xbeg + $xlen - 1 );
186 $ybeg .=
',' . ( $ybeg + $ylen - 1 );
189 return $xbeg . ( $xlen ? ( $ylen ?
'c' :
'd' ) :
'a' ) . $ybeg;
248 protected function changed( $orig, $closing ) {
251 $this->
added( $closing );
if(!file_exists( $CREDITS)) $lines