-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall.php
25 lines (20 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
<?php
$sql = rex_sql::factory();
// Delete url schemes
if (\rex_addon::get('url')->isAvailable()) {
$sql->setQuery('DELETE FROM '. \rex::getTablePrefix() ."url_generator_profile WHERE `namespace` = 'course_id';");
$sql->setQuery('DELETE FROM '. \rex::getTablePrefix() ."url_generator_profile WHERE `namespace` = 'courses_category_id';");
}
// Delete views
$sql->setQuery('DROP VIEW IF EXISTS ' . \rex::getTablePrefix() . 'd2u_courses_url_categories');
$sql->setQuery('DROP VIEW IF EXISTS ' . \rex::getTablePrefix() . 'd2u_courses_url_courses');
// Delete tables
$sql->setQuery('DROP TABLE IF EXISTS ' . \rex::getTablePrefix() . 'd2u_courses_categories');
$sql->setQuery('DROP TABLE IF EXISTS ' . \rex::getTablePrefix() . 'd2u_courses_2_categories');
$sql->setQuery('DROP TABLE IF EXISTS ' . \rex::getTablePrefix() . 'd2u_courses_courses');
// Delete language replacements
if (!class_exists(TobiasKrais\D2UCourses\LangHelper::class)) {
// Load class in case addon is deactivated
require_once 'lib/LangHelper.php';
}
TobiasKrais\D2UCourses\LangHelper::factory()->uninstall();