phpBB

Code Changes

File: phpbb/install/module/update_filesystem/task/diff_files.php

  Unmodified   Added   Modified   Removed
Line 103Line 103
		$old_path = $this->update_helper->get_path_to_old_update_files();
$new_path = $this->update_helper->get_path_to_new_update_files();


		$old_path = $this->update_helper->get_path_to_old_update_files();
$new_path = $this->update_helper->get_path_to_new_update_files();


		$files_to_diff = $this->installer_config->get('update_files', array());
$files_to_diff = $files_to_diff['update_with_diff'];

		$update_files = $this->installer_config->get('update_files', array());
$files_to_diff = $update_files['update_with_diff'];


// Set progress bar
$this->iohandler->set_task_count(count($files_to_diff), true);


// Set progress bar
$this->iohandler->set_task_count(count($files_to_diff), true);

Line 145Line 145
				{
$file_contents[] = file_get_contents($file_to_diff);


				{
$file_contents[] = file_get_contents($file_to_diff);


					if ($file_contents[sizeof($file_contents) - 1] === false)

					if ($file_contents[count($file_contents) - 1] === false)

					{
$this->iohandler->add_error_message(array('FILE_DIFFER_ERROR_FILE_CANNOT_BE_READ', $files_to_diff));
unset($file_contents);

					{
$this->iohandler->add_error_message(array('FILE_DIFFER_ERROR_FILE_CANNOT_BE_READ', $files_to_diff));
unset($file_contents);

Line 154Line 154
				}

$diff = new \diff3($file_contents[0], $file_contents[1], $file_contents[2]);

				}

$diff = new \diff3($file_contents[0], $file_contents[1], $file_contents[2]);

				unset($file_contents);

 

// Handle conflicts
if ($diff->get_num_conflicts() !== 0)


// Handle conflicts
if ($diff->get_num_conflicts() !== 0)

Line 162Line 161
					$merge_conflicts[] = $filename;
}


					$merge_conflicts[] = $filename;
}


 
				if ($diff->merged_output() !== $file_contents[1])
{

				// Save merged output
$this->cache->put(
'_file_' . md5($filename),
base64_encode(implode("\n", $diff->merged_output()))
);

				// Save merged output
$this->cache->put(
'_file_' . md5($filename),
base64_encode(implode("\n", $diff->merged_output()))
);

 
				}
else
{
unset($update_files['update_with_diff'][$key]);
}





 
				unset($file_contents);

				unset($diff);
}
else

				unset($diff);
}
else

Line 198Line 205
				$this->installer_config->set('differ_progress_key', $key);
$this->installer_config->set('merge_conflict_list', $merge_conflicts);
$this->installer_config->set('file_diff_update_count', $progress_count);

				$this->installer_config->set('differ_progress_key', $key);
$this->installer_config->set('merge_conflict_list', $merge_conflicts);
$this->installer_config->set('file_diff_update_count', $progress_count);

 

foreach ($update_files as $type => $files)
{
if (empty($files))
{
unset($update_files[$type]);
}
}

$this->installer_config->set('update_files', $update_files);


// Request refresh
throw new resource_limit_reached_exception();


// Request refresh
throw new resource_limit_reached_exception();

Line 206Line 223

$this->iohandler->finish_progress('ALL_FILES_DIFFED');
$this->installer_config->set('merge_conflict_list', $merge_conflicts);


$this->iohandler->finish_progress('ALL_FILES_DIFFED');
$this->installer_config->set('merge_conflict_list', $merge_conflicts);

 

foreach ($update_files as $type => $files)
{
if (empty($files))
{
unset($update_files[$type]);
}
}

$this->installer_config->set('update_files', $update_files);

	}

/**

	}

/**