Sfoglia il codice sorgente

Change the behaviour of <database> to run any script called on uninstall. Rather than just undoing the database changes.

Kays48 11 anni fa
parent
commit
f115b4f529
2 ha cambiato i file con 5 aggiunte e 3 eliminazioni
  1. 3 1
      Sources/Packages.php
  2. 2 2
      Themes/default/languages/Packages.english.php

+ 3 - 1
Sources/Packages.php

@@ -226,7 +226,9 @@ function PackageInstallTest()
 	$smcFunc['db_free_result']($request);
 
 	$context['database_changes'] = array();
-	if (!empty($db_changes))
+	if (isset($packageInfo['uninstall']['database']))
+		$context['database_changes'][] = $txt['execute_database_changes'] . ' - ' . $packageInfo['uninstall']['database'];
+	elseif (!empty($db_changes))
 	{
 		foreach ($db_changes as $change)
 		{

+ 2 - 2
Themes/default/languages/Packages.english.php

@@ -95,7 +95,7 @@ $txt['package_file'] = 'File';
 $txt['package_tree'] = 'Tree';
 $txt['execute_modification'] = 'Execute Modification';
 $txt['execute_code'] = 'Execute Code';
-$txt['execute_database_changes'] = 'Adapt Database';
+$txt['execute_database_changes'] = 'Execute file';
 $txt['execute_hook_add'] = 'Add Hook';
 $txt['execute_hook_remove'] = 'Remove Hook';
 $txt['execute_hook_action'] = 'Adapting hook %1$s';
@@ -186,7 +186,7 @@ $txt['package_download_filename_info'] = 'Optional value.  Should be used when t
 
 $txt['package_db_uninstall'] = 'Remove all data associated with this modification.';
 $txt['package_db_uninstall_details'] = 'Details';
-$txt['package_db_uninstall_actions'] = 'Checking this option will result in the following database changes';
+$txt['package_db_uninstall_actions'] = 'Checking this option will result in the following actions';
 $txt['package_db_remove_table'] = 'Drop table &quot;%1$s&quot;';
 $txt['package_db_remove_column'] = 'Remove column &quot;%2$s&quot; from &quot;%1$s&quot;';
 $txt['package_db_remove_index'] = 'Remove index &quot;%1$s&quot; from &quot;%2$s&quot;';