forked from last-hero/square_shop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.inc.php
39 lines (34 loc) · 989 Bytes
/
install.inc.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
<?php
$mypage = 'square_shop';
$classes = array('SSDBSchema', 'SSDBSQL', 'SSException', 'SSHelper');
foreach($classes as $class_name){
if (!class_exists($class_name)) {
$classes_folder = $REX['INCLUDE_PATH'] . '/addons/square_shop/classes/';
$file = $classes_folder.''.$class_name.'.php';
if(file_exists($file)) {
require_once $file;
}
$sub_folders = array('model', 'view', 'controller', 'helper');
foreach($sub_folders as $folder){
$file = $classes_folder.''.$folder.'/'.''.$class_name.'.php';
if(file_exists($file)) {
require_once $file;
}
}
}
}
$error = '';
try{
// Tabellen erstellen
SSDBSQL::executeSql(SSDBSQL::_getSqlCreateTables(), false);
// Falls StringTable vorhanden
// Sprachelemente zu StringTable importieren
SSHelper::importTranslationsToStringTable();
}catch(SSException $e) {
$error = $e;
}
if ($error == '') {
$REX['ADDON']['install']['square_shop'] = true;
} else {
$REX['ADDON']['installmsg']['square_shop'] = $error;
}