Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/mod/wiki/diff/difflib.php File Reference

Go to the source code of this file.

Data Structures

class  ouwiki_line
class  ouwiki_word
class  ouwiki_change_range
class  ouwiki_changes

Namespaces

namespace  ouwiki

Functions

 ouwiki_diff_internal ($file1, $file2)
 ouwiki_diff_merge (&$K, &$k, $i, &$E, $p, &$candidates)
 ouwiki_diff_sort_v ($a, $b)
 ouwiki_diff_find_last (&$V, &$E, $hash)
 ouwiki_diff_html_to_lines ($content)
 ouwiki_diff_internal_flip ($diff, $count2)
 ouwiki_diff_words ($lines1, $lines2)
 ouwiki_diff ($file1, $file2)
 ouwiki_diff_add_markers ($html, $words, $markerclass, $beforetext, $aftertext)
 ouwiki_diff_html ($html1, $html2)

Function Documentation

ouwiki_diff ( file1,
file2 
)

Runs diff and interprets results into ouwiki_changes object.

Parameters:
array$file1Array of lines in file 1. The first line in the file MUST BE INDEX 1 NOT ZERO!!
array$file2Array of lines in file 2, again starting from 1.
Returns:
ouwiki_changes Object describing changes

Definition at line 669 of file difflib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

ouwiki_diff_add_markers ( html,
words,
markerclass,
beforetext,
aftertext 
)

Adds HTML span elements to $html around the words listed in $words.

Parameters:
string$htmlHTML content
array$wordsArray of ouwiki_word to mark
string$markerclassName of class for span element
Returns:
HTML with markup added

Definition at line 680 of file difflib.php.

Here is the caller graph for this function:

ouwiki_diff_find_last ( &$  V,
&$  E,
hash 
)

Definition at line 238 of file difflib.php.

Here is the caller graph for this function:

ouwiki_diff_html ( html1,
html2 
)

Compares two HTML files. (This is the main function that everything else supports.)

Parameters:
string$html1XHTML for file 1
string$html2XHTML for file 2
Returns:
array ($result1,$result2) to be displayed indicating the differences

Definition at line 718 of file difflib.php.

Here is the call graph for this function:

ouwiki_diff_html_to_lines ( content)

Prepares XHTML content for text difference comparison.

Parameters:
string$contentXHTML content [NO SLASHES]
Returns:
array Array of ouwiki_line objects

Definition at line 382 of file difflib.php.

Here is the caller graph for this function:

ouwiki_diff_internal ( file1,
file2 
)

Basic diff utility function, using standard diff algorithm.

Based on Bell Laboratories Computing Science Technical Report #41, July 1976, Hunt & McIlroy, Appendix A.1 and A.3.

http://www.cs.dartmouth.edu/~doug/diff.ps

Parameters:
array$file1Array of lines in file 1. The first line in the file MUST BE INDEX 1 NOT ZERO!!
array$file2Array of lines in file 2, again starting from 1.
Returns:
array An array with one entry (again 1-based) for each line in file 1, with its corresponding position in file 2 or 0 if it isn't there.

Definition at line 27 of file difflib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

ouwiki_diff_internal_flip ( diff,
count2 
)

Flips around the array returned by ouwiki_diff_internal so that it refers to lines from the other file.

Parameters:
array$diffArray of index1=>index2
int$count2Count of lines in file 2
Returns:
array Flipped version

Definition at line 566 of file difflib.php.

Here is the caller graph for this function:

ouwiki_diff_merge ( &$  K,
&$  k,
i,
&$  E,
p,
&$  candidates 
)

Definition at line 165 of file difflib.php.

Here is the caller graph for this function:

ouwiki_diff_sort_v ( a,
b 
)

Definition at line 223 of file difflib.php.

ouwiki_diff_words ( lines1,
lines2 
)

Compares two files based initially on lines and then on words within the lines that differ.

Parameters:
array$lines1Array of ouwiki_line
array$lines2Array of ouwiki_line
Returns:
array (deleted,added); deleted and added are arrays of ouwiki_word with position numbers from $lines1 and $lines2 respectively

Definition at line 587 of file difflib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

 All Data Structures Namespaces Files Functions Variables Enumerations