From 7ed41c4de14e5b454e8935c35edef4a0b3c400a9 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 29 Nov 2006 15:51:54 +0000 Subject: updates for the updater and the diff engine. - this update also includes an important change for including the diff engine, since we may need to include an updated engine before updating. This basically means that for a future update (B4 to another version) requires copying the new diff files first... the new include method should prevent this needed handwork for later versions then. git-svn-id: file:///svn/phpbb/trunk@6695 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/diff/renderer.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/diff/renderer.php') diff --git a/phpBB/includes/diff/renderer.php b/phpBB/includes/diff/renderer.php index 984fd65708..6f4400051c 100644 --- a/phpBB/includes/diff/renderer.php +++ b/phpBB/includes/diff/renderer.php @@ -98,15 +98,20 @@ class diff_renderer if (is_a($diff, 'diff3')) { $diff3 = &$diff; - $diff = &new diff($diff3->get_original(), $diff3->merged_output()); + + $diff_1 = $diff3->get_original(); + $diff_2 = $diff3->merged_output(); + unset($diff3); + + $diff = &new diff($diff_1, $diff_2); } $nlead = $this->_leading_context_lines; $ntrail = $this->_trailing_context_lines; $output = $this->_start_diff(); - $diffs = $diff->get_diff(); + $diffs = &$diff->get_diff(); foreach ($diffs as $i => $edit) { @@ -440,7 +445,11 @@ class diff_renderer_inline extends diff_renderer // We want to split on word boundaries, but we need to preserve whitespace as well. // Therefore we split on words, but include all blocks of whitespace in the wordlist. - $diff = &new diff($this->_split_on_words($text1, $nl), $this->_split_on_words($text2, $nl)); + $splitted_text_1 = $this->_split_on_words($text1, $nl); + $splitted_text_2 = $this->_split_on_words($text2, $nl); + + $diff = &new diff($splitted_text_1, $splitted_text_2); + unset($splitted_text_1, $splitted_text_2); // Get the diff in inline format. $renderer = &new diff_renderer_inline(array_merge($this->get_params(), array('split_level' => 'words'))); -- cgit v1.2.1