Example #1
0
 function _changed($orig, $final)
 {
     if ($this->_first >= 0) {
         // stop recursion
         $this->_addBytes += count($final);
         $this->_delBytes += count($orig);
         return;
     }
     $change = diffChar($orig, $final, 0, 'bytes');
     preg_match("/add=([0-9]*)&del=([0-9]*)/", $change, $matches);
     $this->_addBytes += $matches[1];
     $this->_delBytes += $matches[2];
 }
Example #2
0
 function _block($xbeg, $xlen, $ybeg, $ylen, &$edits)
 {
     $this->_startBlock($this->_blockHeader($xbeg, $xlen, $ybeg, $ylen));
     $orig = array();
     $final = array();
     foreach ($edits as $edit) {
         if (is_array($edit->orig)) {
             $orig = array_merge($orig, $edit->orig);
         }
         if (is_array($edit->final)) {
             $final = array_merge($final, $edit->final);
         }
     }
     $lines = diffChar($orig, $final, $this->_words, "character_inline");
     echo "<tr class='diffbody'><td colspan='3'>{$lines['0']}</td></tr>\n";
     $this->_endBlock();
 }
Example #3
0
 function _changed($orig, $final)
 {
     $lines = diffChar($orig, $final, $this->_words);
     $this->_deleted(array($lines[0]), TRUE);
     $this->_added(array($lines[1]), TRUE);
     /* switch with these lines for no character diff
             $this->_deleted($orig, TRUE);
             $this->_added($final, TRUE);
     */
 }
Example #4
0
 function _changed($orig, $final)
 {
     $lines = diffChar($orig, $final, 0);
     $this->_deleted(array($lines[0]));
     $this->_added(array($lines[1]));
 }