[ Index ]

PHP Cross Reference of phpBB 3.0 Beta 3

title

Body

[close]

/includes/diff/ -> diff.php (summary)

(no description)

Copyright: (c) 2006 phpBB Group
License: http://opensource.org/licenses/gpl-license.php GNU Public License
Version: $Id: diff.php,v 1.2 2006/09/02 13:33:05 acydburn Exp $
File Size: 781 lines (15 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 11 classes

diff:: (9 methods):
  diff()
  get_diff()
  reverse()
  is_empty()
  lcs()
  get_original()
  get_final()
  trim_newlines()
  _check()

mapped_diff:: (1 method):
  mapped_diff()

diff_op:: (3 methods):
  reverse()
  norig()
  nfinal()

diff_op_copy:: (2 methods):
  diff_op_copy()
  reverse()

diff_op_delete:: (2 methods):
  diff_op_delete()
  reverse()

diff_op_add:: (2 methods):
  diff_op_add()
  reverse()

diff_op_change:: (2 methods):
  diff_op_change()
  reverse()

diff3:: (6 methods):
  diff3()
  merged_output()
  merged_new_output()
  merged_orig_output()
  get_conflicts()
  _diff3()

diff3_op:: (3 methods):
  diff3_op()
  merged()
  is_conflict()

diff3_op_copy:: (3 methods):
  diff3_op_copy()
  merged()
  is_conflict()

diff3_block_builder:: (8 methods):
  diff3_block_builder()
  input()
  out1()
  out2()
  is_empty()
  finish()
  _init()
  _append()


Class: diff  - X-Ref

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.

diff($from_lines, $to_lines)   X-Ref
Computes diffs between sequences of strings.

param: array $from_lines  An array of strings. Typically these are lines from a file.
param: array $to_lines    An array of strings.

get_diff()   X-Ref
Returns the array of differences.


reverse()   X-Ref
Computes a reversed diff.

Example:
<code>
$diff = &new diff($lines1, $lines2);
$rev = $diff->reverse();
</code>

return: diff  A Diff object representing the inverse of the original diff.

is_empty()   X-Ref
Checks for an empty diff.

return: boolean  True if two sequences were identical.

lcs()   X-Ref
Computes the length of the Longest Common Subsequence (LCS).

This is mostly for diagnostic purposes.

return: integer  The length of the LCS.

get_original()   X-Ref
Gets the original set of lines.

This reconstructs the $from_lines parameter passed to the constructor.

return: array  The original sequence of strings.

get_final()   X-Ref
Gets the final set of lines.

This reconstructs the $to_lines parameter passed to the constructor.

return: array  The sequence of strings.

trim_newlines(&$line, $key)   X-Ref
Removes trailing newlines from a line of text. This is meant to be used with array_walk().

param: string $line  The line to trim.
param: integer $key  The index of the line in the array. Not used.

_check($from_lines, $to_lines)   X-Ref
Checks a diff for validity.

This is here only for debugging purposes.

Class: mapped_diff  - X-Ref


mapped_diff($from_lines, $to_lines, $mapped_from_lines, $mapped_to_lines)   X-Ref
Computes a diff between sequences of strings.

This can be used to compute things like case-insensitve diffs, or diffs
which ignore changes in white-space.

param: array $from_lines         An array of strings.
param: array $to_lines           An array of strings.
param: array $mapped_from_lines  This array should have the same size number of elements as $from_lines.
param: array $mapped_to_lines    This array should have the same number of elements as $to_lines.

Class: diff_op  - X-Ref


reverse()   X-Ref
No description

norig()   X-Ref
No description

nfinal()   X-Ref
No description

Class: diff_op_copy  - X-Ref


diff_op_copy($orig, $final = false)   X-Ref
No description

reverse()   X-Ref
No description

Class: diff_op_delete  - X-Ref


diff_op_delete($lines)   X-Ref
No description

reverse()   X-Ref
No description

Class: diff_op_add  - X-Ref


diff_op_add($lines)   X-Ref
No description

reverse()   X-Ref
No description

Class: diff_op_change  - X-Ref


diff_op_change($orig, $final)   X-Ref
No description

reverse()   X-Ref
No description

Class: diff3  - X-Ref

A class for computing three way diffs.

diff3($orig, $final1, $final2)   X-Ref
Computes diff between 3 sequences of strings.

param: array $orig    The original lines to use.
param: array $final1  The first version to compare to.
param: array $final2  The second version to compare to.

merged_output($label1 = 'CURRENT_FILE', $label2 = 'NEW_FILE', $label_sep = 'DIFF_SEP_EXPLAIN', $get_conflicts = false, $merge_new = false)   X-Ref
Return merged output

param: string $label1 the cvs file version/label from the original set of lines
param: string $label2 the cvs file version/label from the new set of lines
param: string $label_sep the explanation between label1 and label2 - more of a helper for the user
param: bool $get_conflicts if set to true only the number of conflicts is returned
param: bool $merge_new if set to true the merged output will have the new file contents on a conflicting merge
return: mixed the merged output

merged_new_output()   X-Ref
Merge the output and use the new file code for conflicts


merged_orig_output()   X-Ref
Merge the output and use the original file code for conflicts


get_conflicts()   X-Ref
Get conflicting block(s)


_diff3($edits1, $edits2)   X-Ref


Class: diff3_op  - X-Ref


diff3_op($orig = false, $final1 = false, $final2 = false)   X-Ref
No description

merged()   X-Ref
No description

is_conflict()   X-Ref
No description

Class: diff3_op_copy  - X-Ref


diff3_op_copy($lines = false)   X-Ref
No description

merged()   X-Ref
No description

is_conflict()   X-Ref
No description

Class: diff3_block_builder  - X-Ref


diff3_block_builder()   X-Ref
No description

input($lines)   X-Ref
No description

out1($lines)   X-Ref
No description

out2($lines)   X-Ref
No description

is_empty()   X-Ref
No description

finish()   X-Ref
No description

_init()   X-Ref
No description

_append(&$array, $lines)   X-Ref
No description



Generated: Wed Nov 22 00:35:05 2006 Cross-referenced by PHPXref 0.6