mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
- Allow download of conflicting file for later reference in automatic updater
- Default difference view is now 'inline' instead of 'side by side' - Added new option for merging differences to conflicting files in automatic updater git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9252 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
507d8b0385
commit
189e7cdf45
6 changed files with 231 additions and 132 deletions
|
@ -192,94 +192,170 @@
|
||||||
|
|
||||||
<form id="install_update" method="post" action="{U_UPDATE_ACTION}">
|
<form id="install_update" method="post" action="{U_UPDATE_ACTION}">
|
||||||
|
|
||||||
<!-- IF .files -->
|
<!-- IF .up_to_date -->
|
||||||
<!-- BEGIN files -->
|
<h2>{L_FILES_UP_TO_DATE}</h2>
|
||||||
<!-- IF files.S_STATUS -->
|
<p>{L_FILES_UP_TO_DATE_EXPLAIN}</p>
|
||||||
<!-- IF not files.S_FIRST_ROW -->
|
|
||||||
</fieldset></div>
|
<fieldset>
|
||||||
|
<legend><img src="{T_IMAGE_PATH}file_up_to_date.gif" alt="{L_STATUS_UP_TO_DATE}" /></legend>
|
||||||
|
<!-- BEGIN up_to_date -->
|
||||||
|
<dl>
|
||||||
|
<dd class="full" style="text-align: left;"><strong>{up_to_date.FILENAME}</strong></dd>
|
||||||
|
</dl>
|
||||||
|
<!-- END up_to_date -->
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<!-- ENDIF -->
|
||||||
|
|
||||||
|
<!-- IF .new -->
|
||||||
|
<h2>{L_FILES_NEW}</h2>
|
||||||
|
<p>{L_FILES_NEW_EXPLAIN}</p>
|
||||||
|
|
||||||
|
<fieldset>
|
||||||
|
<legend><img src="{T_IMAGE_PATH}file_new.gif" alt="{L_STATUS_NEW}" /></legend>
|
||||||
|
<!-- BEGIN new -->
|
||||||
|
<dl>
|
||||||
|
<dt style="width: 60%;"><strong><!-- IF new.DIR_PART -->{new.DIR_PART}<br /><!-- ENDIF -->{new.FILE_PART}</strong>
|
||||||
|
<!-- IF new.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{new.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
|
||||||
|
</dt>
|
||||||
|
<dd style="margin-left: 60%;">
|
||||||
|
<!-- IF not new.S_BINARY -->[ <a href="{new.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{new.L_SHOW_DIFF}</a>
|
||||||
|
<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
|
||||||
|
</dd>
|
||||||
|
<!-- IF new.S_CUSTOM -->
|
||||||
|
<dd style="margin-left: 60%;"><label><input type="checkbox" name="no_update[]" value="{new.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
|
||||||
|
<!-- ENDIF -->
|
||||||
|
</dl>
|
||||||
|
<!-- END new -->
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<!-- ENDIF -->
|
||||||
|
|
||||||
|
<!-- IF .not_modified -->
|
||||||
|
<h2>{L_FILES_NOT_MODIFIED}</h2>
|
||||||
|
<div style="float: {S_CONTENT_FLOW_END};">» <a href="#" onclick="dE('not_modified', 0); return false;">{L_TOGGLE_DISPLAY}</a></div>
|
||||||
|
<p>{L_FILES_NOT_MODIFIED_EXPLAIN}</p>
|
||||||
|
|
||||||
|
<fieldset id="not_modified" style="display: none;">
|
||||||
|
<legend><img src="{T_IMAGE_PATH}file_not_modified.gif" alt="{L_STATUS_NOT_MODIFIED}" /></legend>
|
||||||
|
<!-- BEGIN not_modified -->
|
||||||
|
<dl>
|
||||||
|
<dt style="width: 60%;"><strong><!-- IF not_modified.DIR_PART -->{not_modified.DIR_PART}<br /><!-- ENDIF -->{not_modified.FILE_PART}</strong>
|
||||||
|
<!-- IF not_modified.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{not_modified.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
|
||||||
|
</dt>
|
||||||
|
<dd style="margin-left: 60%;"><!-- IF not not_modified.S_BINARY -->[ <a href="{not_modified.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{not_modified.L_SHOW_DIFF}</a> ]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd>
|
||||||
|
<!-- IF not_modified.S_CUSTOM -->
|
||||||
|
<dd style="margin-left: 60%;"><label><input type="checkbox" name="no_update[]" value="{not_modified.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
</dl>
|
||||||
|
<!-- END not_modified -->
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
<h2>{files.TITLE}</h2>
|
<!-- ENDIF -->
|
||||||
|
|
||||||
<!-- IF files.STATUS eq 'not_modified' --><div style="float: {S_CONTENT_FLOW_END};">» <a href="#" onclick="dE('not_modified', 0); return false;">{L_TOGGLE_DISPLAY}</a></div><!-- ENDIF -->
|
<!-- IF .modified -->
|
||||||
<p>{files.EXPLAIN}</p>
|
<h2>{L_FILES_MODIFIED}</h2>
|
||||||
|
<p>{L_FILES_MODIFIED_EXPLAIN}</p>
|
||||||
|
|
||||||
<div style="display: <!-- IF files.STATUS neq 'not_modified' -->block<!-- ELSE -->none<!-- ENDIF -->;" id="{files.STATUS}">
|
<!-- BEGIN modified -->
|
||||||
|
<fieldset>
|
||||||
|
<legend><img src="{T_IMAGE_PATH}file_modified.gif" alt="{L_STATUS_MODIFIED}" /></legend>
|
||||||
|
<dl>
|
||||||
|
<dt style="width: 60%;"><strong><!-- IF modified.DIR_PART -->{modified.DIR_PART}<br /><!-- ENDIF -->{modified.FILE_PART}</strong>
|
||||||
|
<!-- IF modified.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{modified.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
|
||||||
|
</dt>
|
||||||
|
<dd style="margin-left: 60%;"> </dd>
|
||||||
|
<!-- IF modified.S_CUSTOM -->
|
||||||
|
<dd style="margin-left: 60%;"><label><input type="checkbox" name="no_update[]" value="{modified.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
|
||||||
|
<!-- ENDIF -->
|
||||||
|
</dl>
|
||||||
|
<dl>
|
||||||
|
<dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{modified.FILENAME}]" value="0" checked="checked" /> {L_MERGE_MODIFICATIONS_OPTION}</label></dt>
|
||||||
|
<dd style="margin-left: 60%;"><!-- IF not modified.S_BINARY -->[ <a href="{modified.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{modified.L_SHOW_DIFF}</a> ]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd>
|
||||||
|
</dl>
|
||||||
|
<dl>
|
||||||
|
<dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{modified.FILENAME}]" value="1" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
|
||||||
|
<dd style="margin-left: 60%;"><!-- IF not modified.S_BINARY -->[<a href="{modified.U_VIEW_NO_MERGE_NEW}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]<!-- ELSE --> <!-- ENDIF --></dd>
|
||||||
|
</dl>
|
||||||
|
<dl>
|
||||||
|
<dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{modified.FILENAME}]" value="2" /> {L_MERGE_NO_MERGE_MOD_OPTION}</label></dt>
|
||||||
|
<dd style="margin-left: 60%;"><!-- IF not modified.S_BINARY -->[<a href="{modified.U_VIEW_NO_MERGE_MOD}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]<!-- ELSE --> <!-- ENDIF --></dd>
|
||||||
|
</dl>
|
||||||
|
</fieldset>
|
||||||
|
<!-- END modified -->
|
||||||
|
|
||||||
<fieldset>
|
<!-- ENDIF -->
|
||||||
<legend><img src="{T_IMAGE_PATH}file_{files.STATUS}.gif" alt="{files.L_STATUS}" /></legend>
|
|
||||||
|
<!-- IF .new_conflict -->
|
||||||
|
<h2>{L_FILES_NEW_CONFLICT}</h2>
|
||||||
|
<p>{L_FILES_NEW_CONFLICT_EXPLAIN}</p>
|
||||||
|
|
||||||
|
<fieldset>
|
||||||
|
<legend><img src="{T_IMAGE_PATH}file_new_conflict.gif" alt="{L_STATUS_NEW_CONFLICT}" /></legend>
|
||||||
|
<!-- BEGIN new_conflict -->
|
||||||
|
<dl>
|
||||||
|
<dt style="width: 60%;"><strong><!-- IF new_conflict.DIR_PART -->{new_conflict.DIR_PART}<br /><!-- ENDIF -->{new_conflict.FILE_PART}</strong>
|
||||||
|
<!-- IF new_conflict.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{new_conflict.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
|
||||||
|
</dt>
|
||||||
|
<dd style="margin-left: 60%;">
|
||||||
|
<!-- IF not new_conflict.S_BINARY -->[ <a href="{new_conflict.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{new_conflict.L_SHOW_DIFF}</a>
|
||||||
|
<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
|
||||||
|
</dd>
|
||||||
|
<!-- IF new_conflict.S_CUSTOM -->
|
||||||
|
<dd style="margin-left: 60%;"><label><input type="checkbox" name="no_update[]" value="{new_conflict.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
|
||||||
|
<!-- ENDIF -->
|
||||||
|
</dl>
|
||||||
|
<!-- END new_conflict -->
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<!-- ENDIF -->
|
||||||
|
|
||||||
|
<!-- IF .conflict -->
|
||||||
|
<h2>{L_FILES_CONFLICT}</h2>
|
||||||
|
<p>{L_FILES_CONFLICT_EXPLAIN}</p>
|
||||||
|
|
||||||
|
<!-- BEGIN conflict -->
|
||||||
|
<fieldset>
|
||||||
|
<legend><img src="{T_IMAGE_PATH}file_conflict.gif" alt="{L_STATUS_CONFLICT}" /></legend>
|
||||||
|
<dl>
|
||||||
|
<dt style="width: 60%;"><strong><!-- IF conflict.DIR_PART -->{conflict.DIR_PART}<br /><!-- ENDIF -->{conflict.FILE_PART}</strong>
|
||||||
|
<!-- IF conflict.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{conflict.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
|
||||||
|
<!-- IF conflict.NUM_CONFLICTS --><br /><span>{L_NUM_CONFLICTS}: {conflict.NUM_CONFLICTS}</span><!-- ENDIF -->
|
||||||
|
</dt>
|
||||||
|
<dd style="margin-left: 60%;">
|
||||||
|
<!-- IF not conflict.S_BINARY -->[ <a href="{conflict.U_SHOW_DIFF}">{L_DOWNLOAD_CONFLICTS}</a> ]<br />{L_DOWNLOAD_CONFLICTS_EXPLAIN}
|
||||||
|
<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
|
||||||
|
</dd>
|
||||||
|
<!-- IF conflict.S_CUSTOM -->
|
||||||
|
<dd style="margin-left: 60%;"><label><input type="checkbox" name="no_update[]" value="{conflict.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
|
||||||
|
<!-- ENDIF -->
|
||||||
|
</dl>
|
||||||
|
<!-- IF conflict.S_BINARY -->
|
||||||
|
<dl>
|
||||||
|
<dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="1" checked="checked" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
|
||||||
|
<dd style="margin-left: 60%;"> </dd>
|
||||||
|
</dl>
|
||||||
<!-- ELSE -->
|
<!-- ELSE -->
|
||||||
<dl>
|
<dl>
|
||||||
<!-- IF files.STATUS eq 'up_to_date' -->
|
<dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="3" checked="checked" /> {L_MERGE_NEW_FILE_OPTION}</label></dt>
|
||||||
<dd class="full" style="text-align: left;"><strong>{files.FILENAME}</strong></dd>
|
<dd style="margin-left: 60%;">[<a href="{conflict.U_VIEW_NEW_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_MODIFIED}</a>]</dd>
|
||||||
<!-- ELSE -->
|
</dl>
|
||||||
<dt style="width: 60%;">
|
<dl>
|
||||||
<strong><!-- IF files.DIR_PART -->{files.DIR_PART}<br /><!-- ENDIF -->{files.FILE_PART}</strong>
|
<dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="4" /> {L_MERGE_MOD_FILE_OPTION}</label></dt>
|
||||||
<!-- IF files.S_CUSTOM -->
|
<dd style="margin-left: 60%;">[<a href="{conflict.U_VIEW_MOD_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_MODIFIED}</a>]</dd>
|
||||||
<br /><span><em>{L_FILE_USED}: </em>{files.CUSTOM_ORIGINAL}</span>
|
</dl>
|
||||||
<!-- ENDIF -->
|
<dl>
|
||||||
<!-- IF files.NUM_CONFLICTS -->
|
<dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="1" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
|
||||||
<br /><span>{L_NUM_CONFLICTS}: {files.NUM_CONFLICTS}</span>
|
<dd style="margin-left: 60%;">[<a href="{conflict.U_VIEW_NO_MERGE_NEW}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd>
|
||||||
<!-- ENDIF -->
|
</dl>
|
||||||
</dt>
|
<dl>
|
||||||
<dd style="margin-left: 60%;"><!-- IF files.STATUS eq 'modified' --> <!-- ELSE --><!-- IF not files.S_BINARY -->[ <a href="{files.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{files.L_SHOW_DIFF}</a> ]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --><!-- ENDIF --></dd>
|
<dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="2" /> {L_MERGE_NO_MERGE_MOD_OPTION}</label></dt>
|
||||||
<!-- IF files.S_CUSTOM -->
|
<dd style="margin-left: 60%;">[<a href="{conflict.U_VIEW_NO_MERGE_MOD}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd>
|
||||||
<dd style="margin-left: 60%;"><label><input type="checkbox" name="no_update[]" value="{files.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
|
</dl>
|
||||||
<!-- ENDIF -->
|
|
||||||
|
|
||||||
<!-- IF files.STATUS eq 'modified' -->
|
|
||||||
</dl>
|
|
||||||
<dl>
|
|
||||||
<dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{files.FILENAME}]" value="0" checked="checked" /> {L_MERGE_MODIFICATIONS_OPTION}</label></dt>
|
|
||||||
<dd style="margin-left: 60%;"><!-- IF not files.S_BINARY -->[ <a href="{files.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{files.L_SHOW_DIFF}</a> ]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd>
|
|
||||||
</dl>
|
|
||||||
<dl>
|
|
||||||
<dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{files.FILENAME}]" value="1" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
|
|
||||||
<dd style="margin-left: 60%;"><!-- IF not files.S_BINARY -->[<a href="{files.U_VIEW_NO_MERGE_NEW}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]<!-- ELSE --> <!-- ENDIF --></dd>
|
|
||||||
</dl>
|
|
||||||
<dl>
|
|
||||||
<dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{files.FILENAME}]" value="2" /> {L_MERGE_NO_MERGE_MOD_OPTION}</label></dt>
|
|
||||||
<dd style="margin-left: 60%;"><!-- IF not files.S_BINARY -->[<a href="{files.U_VIEW_NO_MERGE_MOD}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]<!-- ELSE --> <!-- ENDIF --></dd>
|
|
||||||
</dl>
|
|
||||||
<!-- IF not files.S_LAST_ROW -->
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<fieldset>
|
|
||||||
<legend><img src="{T_IMAGE_PATH}file_{files.STATUS}.gif" alt="{files.L_STATUS}" /></legend>
|
|
||||||
<!-- ENDIF -->
|
|
||||||
|
|
||||||
<!-- ENDIF -->
|
|
||||||
|
|
||||||
<!-- IF files.STATUS eq 'conflict' -->
|
|
||||||
</dl>
|
|
||||||
<dl>
|
|
||||||
<dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{files.FILENAME}]" value="1" checked="checked" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
|
|
||||||
<dd style="margin-left: 60%;"><!-- IF not files.S_BINARY -->[<a href="{files.U_VIEW_NO_MERGE_NEW}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]<!-- ELSE --> <!-- ENDIF --></dd>
|
|
||||||
</dl>
|
|
||||||
<!-- IF not files.S_BINARY -->
|
|
||||||
<dl>
|
|
||||||
<dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{files.FILENAME}]" value="3" /> {L_MERGE_NEW_FILE_OPTION}</label></dt>
|
|
||||||
<dd style="margin-left: 60%;">[<a href="{files.U_VIEW_NEW_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd>
|
|
||||||
</dl>
|
|
||||||
<dl>
|
|
||||||
<dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{files.FILENAME}]" value="4" /> {L_MERGE_MOD_FILE_OPTION}</label></dt>
|
|
||||||
<dd style="margin-left: 60%;">[<a href="{files.U_VIEW_MOD_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd>
|
|
||||||
</dl>
|
|
||||||
<!-- ENDIF -->
|
|
||||||
<!-- IF not files.S_LAST_ROW -->
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<fieldset>
|
|
||||||
<legend><img src="{T_IMAGE_PATH}file_{files.STATUS}.gif" alt="{files.L_STATUS}" /></legend>
|
|
||||||
<!-- ENDIF -->
|
|
||||||
|
|
||||||
<!-- ENDIF -->
|
|
||||||
<!-- ENDIF -->
|
|
||||||
<!-- IF files.STATUS neq 'conflict' and files.STATUS neq 'modified' --></dl><!-- ENDIF -->
|
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<!-- END files -->
|
</fieldset>
|
||||||
|
<!-- END conflict -->
|
||||||
|
|
||||||
</fieldset></div>
|
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
@ -371,7 +447,6 @@
|
||||||
<div class="errorbox">
|
<div class="errorbox">
|
||||||
<p>{L_CONNECTION_FAILED}<br />{ERROR_MSG}</p>
|
<p>{L_CONNECTION_FAILED}<br />{ERROR_MSG}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
|
|
@ -89,6 +89,9 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li>[Fix] Delete user entry from ban list table upon user deletion (Bug #40015 - Patch by TerraFrost)</li>
|
<li>[Fix] Delete user entry from ban list table upon user deletion (Bug #40015 - Patch by TerraFrost)</li>
|
||||||
<li>[Fix] Missing read permission from calls to phpbb_chmod()</li>
|
<li>[Fix] Missing read permission from calls to phpbb_chmod()</li>
|
||||||
|
<li>[Change] Allow download of conflicting file for later reference in automatic updater</li>
|
||||||
|
<li>[Change] Default difference view is now 'inline' instead of 'side by side'</li>
|
||||||
|
<li>[Change] Added new option for merging differences to conflicting files in automatic updater</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<a name="v303"></a><h3>1.ii. Changes since 3.0.3</h3>
|
<a name="v303"></a><h3>1.ii. Changes since 3.0.3</h3>
|
||||||
|
|
|
@ -107,7 +107,7 @@ class diff
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* <code>
|
* <code>
|
||||||
* $diff = new diff($lines1, $lines2);
|
* $diff = &new diff($lines1, $lines2);
|
||||||
* $rev = $diff->reverse();
|
* $rev = $diff->reverse();
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
|
@ -469,33 +469,37 @@ class diff3 extends diff
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return merged output
|
* Return number of conflicts
|
||||||
|
*/
|
||||||
|
function get_num_conflicts()
|
||||||
|
{
|
||||||
|
$conflicts = 0;
|
||||||
|
|
||||||
|
foreach ($this->_edits as $edit)
|
||||||
|
{
|
||||||
|
if ($edit->is_conflict())
|
||||||
|
{
|
||||||
|
$conflicts++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $conflicts;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get conflicts content for download. This is generally a merged file, but preserving conflicts and adding explanations to it.
|
||||||
|
* A user could then go through this file, search for the conflicts and changes the code accordingly.
|
||||||
*
|
*
|
||||||
* @param string $label1 the cvs file version/label from the original set of lines
|
* @param string $label1 the cvs file version/label from the original set of lines
|
||||||
* @param string $label2 the cvs file version/label from the new set of lines
|
* @param string $label2 the cvs file version/label from the new set of lines
|
||||||
* @param string $label_sep the explanation between label1 and label2 - more of a helper for the user
|
* @param string $label_sep the explanation between label1 and label2 - more of a helper for the user
|
||||||
* @param bool $get_conflicts if set to true only the number of conflicts is returned
|
|
||||||
* @param bool $merge_new if set to true the merged output will have the new file contents on a conflicting merge
|
|
||||||
*
|
*
|
||||||
* @return mixed the merged output
|
* @return mixed the merged output
|
||||||
*/
|
*/
|
||||||
function merged_output($label1 = 'CURRENT_FILE', $label2 = 'NEW_FILE', $label_sep = 'DIFF_SEP_EXPLAIN', $get_conflicts = false, $merge_new = false)
|
function get_conflicts_content($label1 = 'CURRENT_FILE', $label2 = 'NEW_FILE', $label_sep = 'DIFF_SEP_EXPLAIN')
|
||||||
{
|
{
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
if ($get_conflicts)
|
|
||||||
{
|
|
||||||
foreach ($this->_edits as $edit)
|
|
||||||
{
|
|
||||||
if ($edit->is_conflict())
|
|
||||||
{
|
|
||||||
$this->_conflicting_blocks++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->_conflicting_blocks;
|
|
||||||
}
|
|
||||||
|
|
||||||
$label1 = (!empty($user->lang[$label1])) ? $user->lang[$label1] : $label1;
|
$label1 = (!empty($user->lang[$label1])) ? $user->lang[$label1] : $label1;
|
||||||
$label2 = (!empty($user->lang[$label2])) ? $user->lang[$label2] : $label2;
|
$label2 = (!empty($user->lang[$label2])) ? $user->lang[$label2] : $label2;
|
||||||
$label_sep = (!empty($user->lang[$label_sep])) ? $user->lang[$label_sep] : $label_sep;
|
$label_sep = (!empty($user->lang[$label_sep])) ? $user->lang[$label_sep] : $label_sep;
|
||||||
|
@ -506,15 +510,12 @@ class diff3 extends diff
|
||||||
{
|
{
|
||||||
if ($edit->is_conflict())
|
if ($edit->is_conflict())
|
||||||
{
|
{
|
||||||
if (!$merge_new)
|
// Start conflict label
|
||||||
{
|
$label_start = array('<<< ' . $label1);
|
||||||
$lines = array_merge($lines, array('<<<<<<<' . ($label1 ? ' ' . $label1 : '')), $edit->final1, array('=======' . ($label_sep ? ' ' . $label_sep : '')), $edit->final2, array('>>>>>>>' . ($label2 ? ' ' . $label2 : '')));
|
$label_mid = array('=== ' . $label_sep);
|
||||||
}
|
$label_end = array('>>> ' . $label2);
|
||||||
else
|
|
||||||
{
|
$lines = array_merge($lines, $label_start, $edit->final1, $label_mid, $edit->final2, $label_end);
|
||||||
$lines = array_merge($lines, $edit->final1);
|
|
||||||
}
|
|
||||||
$this->_conflicting_blocks++;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -371,14 +371,14 @@ class install_update extends module
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_block_vars('files', array(
|
/* $template->assign_block_vars('files', array(
|
||||||
'S_STATUS' => true,
|
'S_STATUS' => true,
|
||||||
'STATUS' => $status,
|
'STATUS' => $status,
|
||||||
'L_STATUS' => $user->lang['STATUS_' . strtoupper($status)],
|
'L_STATUS' => $user->lang['STATUS_' . strtoupper($status)],
|
||||||
'TITLE' => $user->lang['FILES_' . strtoupper($status)],
|
'TITLE' => $user->lang['FILES_' . strtoupper($status)],
|
||||||
'EXPLAIN' => $user->lang['FILES_' . strtoupper($status) . '_EXPLAIN'],
|
'EXPLAIN' => $user->lang['FILES_' . strtoupper($status) . '_EXPLAIN'],
|
||||||
)
|
)
|
||||||
);
|
);*/
|
||||||
|
|
||||||
foreach ($filelist as $file_struct)
|
foreach ($filelist as $file_struct)
|
||||||
{
|
{
|
||||||
|
@ -398,7 +398,7 @@ class install_update extends module
|
||||||
|
|
||||||
$diff_url = append_sid($this->p_master->module_url, "mode=$mode&sub=file_check&action=diff&status=$status&file=" . urlencode($file_struct['filename']));
|
$diff_url = append_sid($this->p_master->module_url, "mode=$mode&sub=file_check&action=diff&status=$status&file=" . urlencode($file_struct['filename']));
|
||||||
|
|
||||||
$template->assign_block_vars('files', array(
|
$template->assign_block_vars($status, array(
|
||||||
'STATUS' => $status,
|
'STATUS' => $status,
|
||||||
|
|
||||||
'FILENAME' => $filename,
|
'FILENAME' => $filename,
|
||||||
|
@ -685,7 +685,7 @@ class install_update extends module
|
||||||
default:
|
default:
|
||||||
$diff = $this->return_diff($this->old_location . $original_filename, $phpbb_root_path . $file_struct['filename'], $this->new_location . $original_filename);
|
$diff = $this->return_diff($this->old_location . $original_filename, $phpbb_root_path . $file_struct['filename'], $this->new_location . $original_filename);
|
||||||
|
|
||||||
$contents = implode("\n", $diff->merged_output());
|
$contents = implode("\n", $diff->merged_new_output());
|
||||||
unset($diff);
|
unset($diff);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1053,7 +1053,7 @@ class install_update extends module
|
||||||
|
|
||||||
$status = request_var('status', '');
|
$status = request_var('status', '');
|
||||||
$file = request_var('file', '');
|
$file = request_var('file', '');
|
||||||
$diff_mode = request_var('diff_mode', 'side_by_side');
|
$diff_mode = request_var('diff_mode', 'inline');
|
||||||
|
|
||||||
// First of all make sure the file is within our file update list with the correct status
|
// First of all make sure the file is within our file update list with the correct status
|
||||||
$found_entry = array();
|
$found_entry = array();
|
||||||
|
@ -1097,9 +1097,7 @@ class install_update extends module
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MERGE_NEW_FILE:
|
/*
|
||||||
case MERGE_MOD_FILE:
|
|
||||||
|
|
||||||
$diff = $this->return_diff($this->old_location . $original_file, $phpbb_root_path . $file, $this->new_location . $original_file);
|
$diff = $this->return_diff($this->old_location . $original_file, $phpbb_root_path . $file, $this->new_location . $original_file);
|
||||||
|
|
||||||
$tmp = array(
|
$tmp = array(
|
||||||
|
@ -1116,17 +1114,37 @@ class install_update extends module
|
||||||
$this->page_title = 'VIEWING_FILE_CONTENTS';
|
$this->page_title = 'VIEWING_FILE_CONTENTS';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
*/
|
||||||
default:
|
// Merge differences and use new phpBB code for conflicted blocks
|
||||||
|
case MERGE_NEW_FILE:
|
||||||
|
case MERGE_MOD_FILE:
|
||||||
|
|
||||||
$diff = $this->return_diff($this->old_location . $original_file, $phpbb_root_path . $file, $this->new_location . $original_file);
|
$diff = $this->return_diff($this->old_location . $original_file, $phpbb_root_path . $file, $this->new_location . $original_file);
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_DIFF_CONFLICT_FILE' => true,
|
'S_DIFF_CONFLICT_FILE' => true,
|
||||||
'NUM_CONFLICTS' => $diff->merged_output(false, false, false, true))
|
'NUM_CONFLICTS' => $diff->get_num_conflicts())
|
||||||
);
|
);
|
||||||
|
|
||||||
$diff = $this->return_diff($phpbb_root_path . $file, $diff->merged_output());
|
$diff = $this->return_diff($phpbb_root_path . $file, ($option == MERGE_NEW_FILE) ? $diff->merged_new_output() : $diff->merged_orig_output());
|
||||||
|
break;
|
||||||
|
|
||||||
|
// Download conflict file
|
||||||
|
default:
|
||||||
|
|
||||||
|
$diff = $this->return_diff($this->old_location . $original_file, $phpbb_root_path . $file, $this->new_location . $original_file);
|
||||||
|
|
||||||
|
header('Pragma: no-cache');
|
||||||
|
header("Content-Type: application/octetstream; name=\"$file\"");
|
||||||
|
header("Content-disposition: attachment; filename=$file");
|
||||||
|
|
||||||
|
@set_time_limit(0);
|
||||||
|
|
||||||
|
echo implode("\n", $diff->get_conflicts_content());
|
||||||
|
|
||||||
|
flush();
|
||||||
|
exit;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1433,9 +1451,9 @@ class install_update extends module
|
||||||
|
|
||||||
unset($tmp);
|
unset($tmp);
|
||||||
|
|
||||||
if ($diff->merged_output(false, false, false, true))
|
if ($diff->get_num_conflicts())
|
||||||
{
|
{
|
||||||
$update_ary['conflicts'] = $diff->_conflicting_blocks;
|
$update_ary['conflicts'] = $diff->get_num_conflicts();
|
||||||
|
|
||||||
// There is one special case... users having merged with a conflicting file... we need to check this
|
// There is one special case... users having merged with a conflicting file... we need to check this
|
||||||
$tmp = array(
|
$tmp = array(
|
||||||
|
@ -1462,7 +1480,7 @@ class install_update extends module
|
||||||
|
|
||||||
$tmp = array(
|
$tmp = array(
|
||||||
'file1' => file_get_contents($phpbb_root_path . $file),
|
'file1' => file_get_contents($phpbb_root_path . $file),
|
||||||
'file2' => implode("\n", $diff->merged_output()),
|
'file2' => implode("\n", $diff->merged_new_output()),
|
||||||
);
|
);
|
||||||
|
|
||||||
// now compare the merged output with the original file to see if the modified file is up to date
|
// now compare the merged output with the original file to see if the modified file is up to date
|
||||||
|
|
|
@ -381,7 +381,7 @@ $lang = array_merge($lang, array(
|
||||||
'COMPLETE_LOGIN_TO_BOARD' => 'You should now <a href="../ucp.php?mode=login">login to your board</a> and check if everything is working fine. Do not forget to delete, rename or move your install directory!',
|
'COMPLETE_LOGIN_TO_BOARD' => 'You should now <a href="../ucp.php?mode=login">login to your board</a> and check if everything is working fine. Do not forget to delete, rename or move your install directory!',
|
||||||
'CONTINUE_UPDATE_NOW' => 'Continue the update process now', // Shown within the database update script at the end if called from the updater
|
'CONTINUE_UPDATE_NOW' => 'Continue the update process now', // Shown within the database update script at the end if called from the updater
|
||||||
'CONTINUE_UPDATE' => 'Continue update now', // Shown after file upload to indicate the update process is not yet finished
|
'CONTINUE_UPDATE' => 'Continue update now', // Shown after file upload to indicate the update process is not yet finished
|
||||||
'CURRENT_FILE' => 'Beginning of current original file',
|
'CURRENT_FILE' => 'Begin of Conflict - Original File code before update',
|
||||||
'CURRENT_VERSION' => 'Current version',
|
'CURRENT_VERSION' => 'Current version',
|
||||||
|
|
||||||
'DATABASE_TYPE' => 'Database type',
|
'DATABASE_TYPE' => 'Database type',
|
||||||
|
@ -391,7 +391,7 @@ $lang = array_merge($lang, array(
|
||||||
'DESTINATION' => 'Destination file',
|
'DESTINATION' => 'Destination file',
|
||||||
'DIFF_INLINE' => 'Inline',
|
'DIFF_INLINE' => 'Inline',
|
||||||
'DIFF_RAW' => 'Raw unified diff',
|
'DIFF_RAW' => 'Raw unified diff',
|
||||||
'DIFF_SEP_EXPLAIN' => 'End of current original file / Beginning of new updated file',
|
'DIFF_SEP_EXPLAIN' => 'Code block used within the updated/new file',
|
||||||
'DIFF_SIDE_BY_SIDE' => 'Side by Side',
|
'DIFF_SIDE_BY_SIDE' => 'Side by Side',
|
||||||
'DIFF_UNIFIED' => 'Unified diff',
|
'DIFF_UNIFIED' => 'Unified diff',
|
||||||
'DO_NOT_UPDATE' => 'Do not update this file',
|
'DO_NOT_UPDATE' => 'Do not update this file',
|
||||||
|
@ -399,6 +399,8 @@ $lang = array_merge($lang, array(
|
||||||
'DOWNLOAD' => 'Download',
|
'DOWNLOAD' => 'Download',
|
||||||
'DOWNLOAD_AS' => 'Download as',
|
'DOWNLOAD_AS' => 'Download as',
|
||||||
'DOWNLOAD_UPDATE_METHOD_BUTTON' => 'Download modified files archive (recommended)',
|
'DOWNLOAD_UPDATE_METHOD_BUTTON' => 'Download modified files archive (recommended)',
|
||||||
|
'DOWNLOAD_CONFLICTS' => 'Download conflicts for this file',
|
||||||
|
'DOWNLOAD_CONFLICTS_EXPLAIN' => 'Search for <<< to spot conflicts',
|
||||||
'DOWNLOAD_UPDATE_METHOD' => 'Download modified files archive',
|
'DOWNLOAD_UPDATE_METHOD' => 'Download modified files archive',
|
||||||
'DOWNLOAD_UPDATE_METHOD_EXPLAIN' => 'Once downloaded you should unpack the archive. You will find the modified files you need to upload to your phpBB root directory within it. Please upload the files to their respective locations then. After you have uploaded all files, please check the files again with the other button below.',
|
'DOWNLOAD_UPDATE_METHOD_EXPLAIN' => 'Once downloaded you should unpack the archive. You will find the modified files you need to upload to your phpBB root directory within it. Please upload the files to their respective locations then. After you have uploaded all files, please check the files again with the other button below.',
|
||||||
|
|
||||||
|
@ -443,13 +445,13 @@ $lang = array_merge($lang, array(
|
||||||
|
|
||||||
'MERGE_NO_MERGE_NEW_OPTION' => 'Do not merge - use new file',
|
'MERGE_NO_MERGE_NEW_OPTION' => 'Do not merge - use new file',
|
||||||
'MERGE_NO_MERGE_MOD_OPTION' => 'Do not merge - use currently installed file',
|
'MERGE_NO_MERGE_MOD_OPTION' => 'Do not merge - use currently installed file',
|
||||||
'MERGE_MOD_FILE_OPTION' => 'Merge differences and use modified code within conflicting block',
|
'MERGE_MOD_FILE_OPTION' => 'Merge modifications (Loose new phpBB code within conflicting block)',
|
||||||
'MERGE_NEW_FILE_OPTION' => 'Merge differences and use new file code within conflicting block',
|
'MERGE_NEW_FILE_OPTION' => 'Merge modifications (Loose modified code within conflicting block)',
|
||||||
'MERGE_SELECT_ERROR' => 'Conflicting file merge modes are not correctly selected.',
|
'MERGE_SELECT_ERROR' => 'Conflicting file merge modes are not correctly selected.',
|
||||||
'MERGING_FILES' => 'Merging differences',
|
'MERGING_FILES' => 'Merging differences',
|
||||||
'MERGING_FILES_EXPLAIN' => 'Currently collecting final file changes.<br /><br />Please wait until phpBB has completed all operations on changed files.',
|
'MERGING_FILES_EXPLAIN' => 'Currently collecting final file changes.<br /><br />Please wait until phpBB has completed all operations on changed files.',
|
||||||
|
|
||||||
'NEW_FILE' => 'End of new updated file',
|
'NEW_FILE' => 'End of Conflict',
|
||||||
'NEW_USERNAME' => 'New username',
|
'NEW_USERNAME' => 'New username',
|
||||||
'NO_AUTH_UPDATE' => 'Not authorised to update',
|
'NO_AUTH_UPDATE' => 'Not authorised to update',
|
||||||
'NO_ERRORS' => 'No errors',
|
'NO_ERRORS' => 'No errors',
|
||||||
|
|
Loading…
Add table
Reference in a new issue