phpBB

Code Changes

File: includes/diff/diff.php

  Unmodified   Added   Modified   Removed
Line 50Line 50
	* @param array	&$to_content	An array of strings.
* @param bool $preserve_cr If true, \r is replaced by a new line in the diff output
*/

	* @param array	&$to_content	An array of strings.
* @param bool $preserve_cr If true, \r is replaced by a new line in the diff output
*/

	function diff(&$from_content, &$to_content, $preserve_cr = true)

	function __construct(&$from_content, &$to_content, $preserve_cr = true)

	{
$diff_engine = new diff_engine();
$this->_edits = $diff_engine->diff($from_content, $to_content, $preserve_cr);

	{
$diff_engine = new diff_engine();
$this->_edits = $diff_engine->diff($from_content, $to_content, $preserve_cr);

Line 330Line 330
	*                                  compared when computing the diff.
* @param array $mapped_to_lines This array should have the same number of elements as $to_lines.
*/

	*                                  compared when computing the diff.
* @param array $mapped_to_lines This array should have the same number of elements as $to_lines.
*/

	function mapped_diff(&$from_lines, &$to_lines, &$mapped_from_lines, &$mapped_to_lines)

	function __construct(&$from_lines, &$to_lines, &$mapped_from_lines, &$mapped_to_lines)

	{
if (count($from_lines) != count($mapped_from_lines) || count($to_lines) != count($mapped_to_lines))
{
return false;
}


	{
if (count($from_lines) != count($mapped_from_lines) || count($to_lines) != count($mapped_to_lines))
{
return false;
}


		parent::diff($mapped_from_lines, $mapped_to_lines);

		parent::__construct($mapped_from_lines, $mapped_to_lines);


$xi = $yi = 0;
for ($i = 0; $i < count($this->_edits); $i++)


$xi = $yi = 0;
for ($i = 0; $i < count($this->_edits); $i++)

Line 394Line 394
*/
class diff_op_copy extends diff_op
{

*/
class diff_op_copy extends diff_op
{

	function diff_op_copy($orig, $final = false)

	function __construct($orig, $final = false)

	{
if (!is_array($final))
{

	{
if (!is_array($final))
{

Line 419Line 419
*/
class diff_op_delete extends diff_op
{

*/
class diff_op_delete extends diff_op
{

	function diff_op_delete($lines)

	function __construct($lines)

	{
$this->orig = $lines;
$this->final = false;

	{
$this->orig = $lines;
$this->final = false;

Line 440Line 440
*/
class diff_op_add extends diff_op
{

*/
class diff_op_add extends diff_op
{

	function diff_op_add($lines)

	function __construct($lines)

	{
$this->final = $lines;
$this->orig = false;

	{
$this->final = $lines;
$this->orig = false;

Line 461Line 461
*/
class diff_op_change extends diff_op
{

*/
class diff_op_change extends diff_op
{

	function diff_op_change($orig, $final)

	function __construct($orig, $final)

	{
$this->orig = $orig;
$this->final = $final;

	{
$this->orig = $orig;
$this->final = $final;

Line 498Line 498
	* @param bool $preserve_cr	If true, \r\n and bare \r are replaced by a new line
* in the diff output
*/

	* @param bool $preserve_cr	If true, \r\n and bare \r are replaced by a new line
* in the diff output
*/

	function diff3(&$orig, &$final1, &$final2, $preserve_cr = true)

	function __construct(&$orig, &$final1, &$final2, $preserve_cr = true)

	{
$diff_engine = new diff_engine();


	{
$diff_engine = new diff_engine();


Line 754Line 754
*/
class diff3_op
{

*/
class diff3_op
{

	function diff3_op($orig = false, $final1 = false, $final2 = false)

	function __construct($orig = false, $final1 = false, $final2 = false)

	{
$this->orig = $orig ? $orig : array();
$this->final1 = $final1 ? $final1 : array();

	{
$this->orig = $orig ? $orig : array();
$this->final1 = $final1 ? $final1 : array();

Line 1066Line 1066
*/
class diff3_op_copy extends diff3_op
{

*/
class diff3_op_copy extends diff3_op
{

	function diff3_op_copy($lines = false)

	function __construct($lines = false)

	{
$this->orig = $lines ? $lines : array();
$this->final1 = &$this->orig;

	{
$this->orig = $lines ? $lines : array();
$this->final1 = &$this->orig;

Line 1092Line 1092
*/
class diff3_block_builder
{

*/
class diff3_block_builder
{

	function diff3_block_builder()

	function __construct()

	{
$this->_init();
}

	{
$this->_init();
}