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

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