00001 <?php 00011 class Text_Diff_Renderer_unified extends Text_Diff_Renderer { 00012 00016 public $_leading_context_lines = 4; 00017 00021 public $_trailing_context_lines = 4; 00022 00023 function _blockHeader($xbeg, $xlen, $ybeg, $ylen) 00024 { 00025 if ($xlen != 1) { 00026 $xbeg .= ',' . $xlen; 00027 } 00028 if ($ylen != 1) { 00029 $ybeg .= ',' . $ylen; 00030 } 00031 return "@@ -$xbeg +$ybeg @@"; 00032 } 00033 00034 function _added($lines) 00035 { 00036 return $this->_lines($lines, '+'); 00037 } 00038 00039 function _deleted($lines) 00040 { 00041 return $this->_lines($lines, '-'); 00042 } 00043 00044 function _changed($orig, $final) 00045 { 00046 return $this->_deleted($orig) . $this->_added($final); 00047 } 00048 00049 }
1.7.1