Text_Diff
[ class tree: Text_Diff ] [ index: Text_Diff ] [ all elements ]

Source for file unified.php

Documentation is available at unified.php

  1. <?php
  2. /**
  3.  * "Unified" diff renderer.
  4.  *
  5.  * This class renders the diff in classic "unified diff" format.
  6.  *
  7.  * $Horde: framework/Text_Diff/Diff/Renderer/unified.php,v 1.2 2004/01/09 21:46:30 chuck Exp $
  8.  *
  9.  * @package Text_Diff
  10.  */
  11.  
  12.     /**
  13.      * Number of leading context "lines" to preserve.
  14.      */
  15.     var $_leading_context_lines = 4;
  16.  
  17.     /**
  18.      * Number of trailing context "lines" to preserve.
  19.      */
  20.     var $_trailing_context_lines = 4;
  21.  
  22.     function _blockHeader($xbeg$xlen$ybeg$ylen)
  23.     {
  24.         if ($xlen != 1{
  25.             $xbeg .= ',' $xlen;
  26.         }
  27.         if ($ylen != 1{
  28.             $ybeg .= ',' $ylen;
  29.         }
  30.         return "@@ -$xbeg +$ybeg @@";
  31.     }
  32.  
  33.     function _added($lines)
  34.     {
  35.         return $this->_lines($lines'+');
  36.     }
  37.  
  38.     function _deleted($lines)
  39.     {
  40.         return $this->_lines($lines'-');
  41.     }
  42.  
  43.     function _changed($orig$final)
  44.     {
  45.         return $this->_deleted($orig$this->_added($final);
  46.     }
  47.  
  48. }

Documentation generated on Mon, 11 Mar 2019 14:16:38 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.