forked from PhantomVl/sccp_manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuninstall.php
42 lines (34 loc) · 1.73 KB
/
uninstall.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/* $Id:$ */
/* !TODO!: In an ideal world this should roll back everything the install.php script did, except for what existed before install.php was run */
/* !TODO!: This would require the install.php to make a note of all the actions that were skipped and/or performed */
/* !TODO!: Might be a good idea to create a backup of the database before removing anything */
// !TODO!: -TODO-: I remove only that which is related to the Manager, it is in my opinion not a critical configuration information. This information is partially present in other files.
if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
global $db;
$version = FreePBX::Config()->get('ASTVERSION');
echo "dropping table sccpdevmodel..";
sql("DROP TABLE IF EXISTS `sccpdevmodel`");
echo "dropping table sccpsettings..";
sql("DROP TABLE IF EXISTS `sccpsettings`");
if (!empty($version)) {
// Woo, we have a version
$check = $db->getRow("SELECT 1 FROM `kvstore` LIMIT 0", DB_FETCHMODE_ASSOC);
if (!(DB::IsError($check))) {
//print_r("none, creating table :". $value);
echo "Deleting key FROM kvstore..";
sql("DELETE FROM kvstore WHERE module = 'sccpsettings'");
sql("DELETE FROM kvstore WHERE module = 'Sccp_manager'");
}
/* Comment: Maybe save in sccpsettings, if the chan_sccp tables already existed in the database or if they were created by install.php */
/* So that you know if it is save to drop/delete them */
/* DROP VIEW `sccpdeviceconfig`;
DROP TABLE `buttonconfig`;
DROP TABLE `sccpdevice`;
DROP TABLE `sccpdevmodel`;
DROP TABLE `sccpline`;
DROP TABLE `sccpsettings`;
*/
}
echo "done<br>\n";
?>