-
Notifications
You must be signed in to change notification settings - Fork 37
/
uninstall.php
34 lines (26 loc) · 1.07 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
<?php
/**
* @var rex_addon $this
* @psalm-scope-this rex_addon
*/
$sql = rex_sql::factory();
$sql->setQuery('DELETE FROM `' . rex::getTable('yform_table') . '` WHERE table_name = "' . rex::getTable('ycom_user') . '"');
$sql->setQuery('DELETE FROM `' . rex::getTable('yform_field') . '` WHERE table_name = "' . rex::getTable('ycom_user') . '"');
$sql->setQuery('DELETE FROM `' . rex::getTable('yform_history') . '` WHERE table_name = "' . rex::getTable('ycom_user') . '"');
rex_sql_table::get(rex::getTable('article'))
->removeColumn('ycom_auth_type')
->removeColumn('ycom_group_type')
->removeColumn('ycom_groups')
->alter();
rex_sql_table::get(rex::getTable('ycom_user_session'))
->drop();
rex_sql_table::get(rex::getTable('ycom_user'))
->drop();
foreach ($this->getInstalledPlugins() as $plugin) {
// use path relative to __DIR__ to get correct path in update temp dir
$file = __DIR__ . '/plugins/' . $plugin->getName() . '/uninstall.php';
if (file_exists($file)) {
$plugin->includeFile($file);
}
}
rex_yform_manager_table::deleteCache();