From a32902e910785f3320fe1370b88f6dda493cd063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Andr=C3=A9s?= Date: Sat, 31 Oct 2020 22:25:59 -0600 Subject: [PATCH] fix removing schedule task on uninstall MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Diego Andrés --- install.php | 10 ---------- package-info.xml | 9 +++++---- uninstall.php | 27 +++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 14 deletions(-) create mode 100644 uninstall.php diff --git a/install.php b/install.php index e4190f3..fe2d9ce 100644 --- a/install.php +++ b/install.php @@ -924,14 +924,4 @@ ); } - } - else - { - $smcFunc['db_query']('', ' - DELETE FROM {db_prefix}scheduled_tasks - WHERE task = {string:name}', - [ - 'name' => 'shop_bank_interest', - ] - ); } \ No newline at end of file diff --git a/package-info.xml b/package-info.xml index fe16c21..97530ac 100644 --- a/package-info.xml +++ b/package-info.xml @@ -35,18 +35,19 @@ Source files - Language file + Language files Shop icon Shop Stats icons - Main template - Admin template + Template files - Shop items and modules + Shop items install.php + + uninstall.php \ No newline at end of file diff --git a/uninstall.php b/uninstall.php new file mode 100644 index 0000000..1396402 --- /dev/null +++ b/uninstall.php @@ -0,0 +1,27 @@ + + * @copyright Copyright (c) 2020, SMF Tricks + * @license https://www.mozilla.org/en-US/MPL/2.0/ + */ + +if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF')) + require_once(dirname(__FILE__) . '/SSI.php'); + +elseif (!defined('SMF')) + exit('Error: Cannot install - please verify you put this in the same place as SMF\'s index.php.'); + +global $smcFunc, $context; + +db_extend('packages'); + +$smcFunc['db_query']('', ' + DELETE FROM {db_prefix}scheduled_tasks + WHERE task = {string:name}', + [ + 'name' => 'shop_bank_interest', + ] +); \ No newline at end of file