+
indeed means a line is added, a -
means a line is removed. A !
means a line has changed (although not every type of diff might use a !
). Similarly, a >
means a line has been added, and <
means a line has been removed, they're more or less the same as +
and -
.A .diff file really isn't very different from the 'open/find/edit' files phpBB used to provide. The only thing is that these phpBB update files were made with in mind that those files are all about updating. If you see a diff-file made with
<
and >
markups, you see it's all about difference, and not necessarily about updating. It's just 'This is present in file 1, and not in file 2', and that's it. What you'll be doing with that information is up to you.The
-
and +
markup already has a notion of updating, although technically it is entirely the same as a markup with <
and >
.Of course, you can update an installation with .diff-files, if you think of them as update-files. But you can do more with with diff-files than just updating, if you think of them in the broader sense as difference-files. Unfortunately, this broad applicability does make diff-files more cryptical then they need to be if you're just updating. These observations might be essential in understanding the difference between phpBB update files and .diff files.
To illustrate the similarities between the two methods, I'll provide some equivalent parts of patch files below, taken from two phpBB3.0 mods.
Equivalent set #1:
Code: Select all
<open src="includes/mcp/mcp_pm_reports.php">
<edit>
<find><![CDATA[ close_report($report_id_list, $mode, $action, true);]]></find>
<action type="before-add"><![CDATA[ // BEGIN Moderator Needed Mod
$cache->purge('_reported_pms');
// END Moderator Needed Mod]]></action>
</edit>
</open>
Code: Select all
diff -wru /phpBB3/includes/mcp/mcp_pm_reports.php /phpBB3-mod/includes/mcp/mcp_pm_reports.php
--- /phpBB3/includes/mcp/mcp_pm_reports.php 2013-12-05 13:57:00.000000000 +0100
+++ /phpBB3-mod/includes/mcp/mcp_pm_reports.php 2013-12-20 13:16:15.000000000 +0100
@@ -61,6 +61,10 @@
include($phpbb_root_path . 'includes/mcp/mcp_reports.' . $phpEx);
}
+ // BEGIN Moderator Needed Mod
+ $cache->purge('_reported_pms');
+ // END Moderator Needed Mod
+
close_report($report_id_list, $mode, $action, true);
break;
Code: Select all
<open src="includes/constants.php">
<edit>
<find>// Additional constants</find>
<action type="after-add">define('HIDE_BBCODE_ID', 1000);</action>
</edit>
</open>
Code: Select all
diff -wru /phpBB3/includes/constants.php /phpBB3-mod/includes/constants.php
--- /phpBB3/includes/constants.php 2013-12-05 13:56:59.000000000 +0100
+++ /phpBB3-mod/includes/constants.php 2013-12-20 13:16:15.000000000 +0100
@@ -211,6 +211,7 @@
// Additional constants
+define('HIDE_BBCODE_ID', 1000);
// Table names
define('ACL_GROUPS_TABLE', $table_prefix . 'acl_groups');
Code: Select all
<open src="includes/message_parser.php">
<edit>
<find> function decode_message($custom_bbcode_uid = '', $update_this_message = true)</find>
<inline-edit>
<inline-find>, $update_this_message = true</inline-find>
<inline-action type="after-add">, $unhide = true</inline-action>
</inline-edit>
</edit>
</open>
Code: Select all
diff -wru /phpBB3/includes/message_parser.php /phpBB3-mod/includes/message_parser.php
--- /phpBB3/includes/message_parser.php 2013-12-05 13:57:00.000000000 +0100
+++ /phpBB3-mod/includes/message_parser.php 2013-12-05 13:37:37.000000000 +0100
@@ -1246,7 +1246,7 @@
/**
* Decode message to be placed back into form box
*/
- function decode_message($custom_bbcode_uid = '', $update_this_message = true)
+ function decode_message($custom_bbcode_uid = '', $update_this_message = true, $unhide = true)
{
// If false, then the parsed message get returned but internal message not processed.
if (!$update_this_message)
