# includes/diff
'AncestorComparator' => 'includes/diff/HTMLDiff.php',
- 'AncestorComparatorResult' => 'includes/diff/HTMLDiff.php',
'AnchorToString' => 'includes/diff/HTMLDiff.php',
'ArrayDiffFormatter' => 'includes/diff/DifferenceEngine.php',
'BodyNode' => 'includes/diff/Nodes.php',
'_DiffOp' => 'includes/diff/DifferenceEngine.php',
'DomTreeBuilder' => 'includes/diff/HTMLDiff.php',
'DummyNode' => 'includes/diff/Nodes.php',
- 'EchoingContentHandler' => 'includes/diff/HTMLDiff.php',
'HTMLDiffer' => 'includes/diff/HTMLDiff.php',
'HTMLOutput' => 'includes/diff/HTMLDiff.php',
'_HWLDF_WordAccumulator' => 'includes/diff/DifferenceEngine.php',
$result = $acthis->getResult($acother);
unset($acthis, $acother);
- if ($result->changed) {
+ if ( $result ) {
$mod = new Modification(Modification::CHANGED);
if (!$this->changedIDUsed) {
$mod->firstOfID = true;
- } else if (!is_null($result->changes) && $result->changes !== $this->changes) {
+ } else if (!is_null( $result ) && $result !== $this->changes) {
++$this->changedID;
$mod->firstOfID = true;
}
- $mod->changes = $result->changes;
+ $mod->changes = $result;
$mod->id = $this->changedID;
$this->textNodes[$i]->modification = $mod;
- $this->changes = $result->changes;
+ $this->changes = $result;
$this->changedIDUsed = true;
} else if ($this->changedIDUsed) {
++$this->changedID;
}
}
-class AncestorComparatorResult {
-
- public $changed = false;
-
- public $changes = "";
-}
-
/**
* A comparator used when calculating the difference in ancestry of two Nodes.
*/
public $compareTxt = "";
public function getResult(AncestorComparator $other) {
- $result = new AncestorComparatorResult();
$diffengine = new WikiDiff3(10000, 1.35);
$differences = $diffengine->diff_range($other->ancestorsText,$this->ancestorsText);
if (count($differences) == 0){
- return $result;
+ return null;
}
$changeTxt = new ChangeTextGenerator($this, $other);
- $result->changed = true;
- $result->changes = $changeTxt->getChanged($differences)->toString();
-
- return $result;
+ return $changeTxt->getChanged($differences)->toString();;
}
}
}
}
-class EchoingContentHandler {
-
- function startElement($qname, /*array*/ $arguments) {
- echo Xml::openElement($qname, $arguments);
- }
-
- function endElement($qname){
- echo Xml::closeElement($qname);
- }
-
- function characters($chars){
- echo htmlspecialchars($chars);
- }
-
- function html($html){
- echo $html;
- }
-
-}
-
class DelegatingContentHandler {
private $delegate;