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

Class: Text_Diff

Source Location: /Text_Diff-0.0.2/Diff.php

Class Overview


Text_Diff


Author(s):

Methods


Child classes:

Text_Diff3
A class for computing three way diffs.
Text_MappedDiff
$Horde: framework/Text_Diff/Diff.php,v 1.5 2004/03/19 18:53:11 chuck Exp $

Inherited Variables

Inherited Methods


Class Details

[line 16]
Text_Diff

General API for generating and formatting diffs - the differences between two sequences of strings.

The PHP diff code used in this package was originally written by Geoffrey T. Dairiki and is used with his permission.

$Horde: framework/Text_Diff/Diff.php,v 1.5 2004/03/19 18:53:11 chuck Exp $



[ Top ]


Method Detail

Text_Diff (Constructor)   [line 32]

Text_Diff Text_Diff( $from_lines $from_lines, $to_lines $to_lines)

Computes diff between sequences of strings.

Parameters:

$from_lines   $from_lines   —  array An array of strings. (Typically these are lines from a file.)
$to_lines   $to_lines   —  array An array of strings.

[ Top ]

   [line 138]

array ( )

Get the final set of lines.

This reconstructs the $to_lines parameter passed to the constructor.

  • Return: The sequence of strings.

[ Top ]

getDiff   [line 49]

void getDiff( )

Return the array of differences.

[ Top ]

isEmpty   [line 82]

boolean isEmpty( )

Check for empty diff.
  • Return: True iff two sequences were identical.

[ Top ]

lcs   [line 99]

int lcs( )

Compute the length of the Longest Common Subsequence (LCS).

This is mostly for diagnostic purposed.

  • Return: The length of the LCS.

[ Top ]

orig   [line 118]

array orig( )

Get the original set of lines.

This reconstructs the $from_lines parameter passed to the constructor.

  • Return: The original sequence of strings.

[ Top ]

reverse   [line 67]

object A reverse( )

Compute reversed diff.

SYNOPSIS:

$diff = &new Text_Diff($lines1, $lines2); $rev = $diff->reverse();

  • Return: Diff object representing the inverse of the original diff. Note that we purposely don't return a reference here, since this essentially is a clone() method.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 10:15:12 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.