Skip to content

Commit

Permalink
fix removing schedule task on uninstall
Browse files Browse the repository at this point in the history
Signed-off-by: Diego Andrés <[email protected]>
  • Loading branch information
DiegoAndresCortes committed Nov 1, 2020
1 parent ac3bc65 commit a32902e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 14 deletions.
10 changes: 0 additions & 10 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -924,14 +924,4 @@
);

}
}
else
{
$smcFunc['db_query']('', '
DELETE FROM {db_prefix}scheduled_tasks
WHERE task = {string:name}',
[
'name' => 'shop_bank_interest',
]
);
}
9 changes: 5 additions & 4 deletions package-info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,19 @@
<!-- Source Files -->
<remove-dir name="$sourcedir/Shop">Source files</remove-dir>
<!-- Languages -->
<remove-file name="$languagedir/Shop.english.php">Language file</remove-file>
<remove-dir name="$languagedir/Shop">Language files</remove-dir>
<!-- Images -->
<remove-file name="$imagesdir/icons/shop.png">Shop icon</remove-file>
<remove-dir name="$imagesdir/icons/shop">Shop Stats icons</remove-dir>
<!-- Templates -->
<remove-file name="$themedir/Shop.template.php">Main template</remove-file>
<remove-file name="$themedir/ShopAdmin.template.php">Admin template</remove-file>
<remove-dir name="$themedir/Shop">Template files</remove-dir>
<!-- Item Modules and Images -->
<remove-dir name="$boarddir/shop_items">Shop items and modules</remove-dir>
<remove-dir name="$boarddir/shop_items">Shop items</remove-dir>
<!-- Hooks Remove -->
<hook hook="integrate_pre_load" function="Shop::initialize" file="$sourcedir/Shop/Shop.php" reverse="true" />
<!-- Database -->
<database>install.php</database>
<!-- Tasks-->
<code>uninstall.php</code>
</uninstall>
</package-info>
27 changes: 27 additions & 0 deletions uninstall.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

/**
* @package ST Shop
* @version 4.0
* @author Diego Andrés <[email protected]>
* @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('<b>Error:</b> 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',
]
);

0 comments on commit a32902e

Please sign in to comment.