-
Notifications
You must be signed in to change notification settings - Fork 5
/
TS_upgrade.php
63 lines (52 loc) · 1.52 KB
/
TS_upgrade.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF'))
require_once(dirname(__FILE__) . '/SSI.php');
elseif (!defined('SMF'))
die('<b>Error:</b> Cannot install - please verify you put this in the same place as SMF\'s index.php.');
global $smcFunc, $sourcedir, $modSettings, $txt;
if (!array_key_exists('db_add_column', $smcFunc))
db_extend('packages');
// Just to avoid logging errors...
$txt['sm_testsuite'] = 'Test Suite';
$txt['ts_admin'] = 'Manage Test Suite';
add_integration_function('integrate_pre_include', $sourcedir . '/Hooks-SM-TestSuite.php', true);
add_integration_function('integrate_actions', 'TS_AddAction', true);
add_integration_function('integrate_menu_buttons', 'TS_AddToMenu', true);
$tables = array(
'testsuite_permissions' => array(
'columns' => array(
array(
'name' => 'id_group',
'type' => 'smallint',
'size' => 5,
'default' => 0,
),
array(
'name' => 'permission',
'type' => 'varchar',
'size' => 30,
'default' => '',
),
array(
'name' => 'id_suite',
'type' => 'smallint',
'size' => 5,
'default' => 0,
),
array(
'name' => 'id_project',
'type' => 'smallint',
'size' => 5,
'default' => 0,
),
),
),
);
foreach ($tables as $table => $data)
{
$smcFunc['db_create_table']('{db_prefix}' . $table, $data['columns']);
}
if (SMF == 'SSI')
echo 'Database adaptation successful!';
redirectexit($boardurl . '?action=testsuite');
?>