-
Notifications
You must be signed in to change notification settings - Fork 131
/
update.php
61 lines (52 loc) · 1.98 KB
/
update.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
<?php
error_reporting(0);
// Check if directory templates_c exists and is writable
if (!file_exists("./templates_c") or !is_writable("./templates_c")) {
die("Required folder templates_c does not exist or is not writable. <br>Please create the folder or make it writable in order to proceed.");
}
require("./init.php");
// VERSION-DEPENDENT
//3.0
// Create table for assignment of personal messages
$conn->query("
CREATE TABLE IF NOT EXISTS `messages_assigned`
(
`id` INT(10) NOT NULL auto_increment,
`user` INT(10) NOT NULL,
`message` INT(10) NOT NULL,
PRIMARY KEY (`id`),
KEY `user` (`user`)
)
DEFAULT charset=utf8;
");
// VERSION-INDEPENDENT
// Clear templates cache
$handle = opendir($template->compile_dir);
while (false !== ($file = readdir($handle))) {
if ($file != "." and $file != "..") {
unlink(CL_ROOT . "/" . $template->compile_dir . "/" . $file);
}
}
// Optimize tables
$conn->query("OPTIMIZE TABLE `company`");
$conn->query("OPTIMIZE TABLE `customers_assigned`");
$conn->query("OPTIMIZE TABLE `files`");
$conn->query("OPTIMIZE TABLE `files_attached`");
$conn->query("OPTIMIZE TABLE `log`");
$conn->query("OPTIMIZE TABLE `messages`");
$conn->query("OPTIMIZE TABLE `messages_assigned`");
$conn->query("OPTIMIZE TABLE `milestones`");
$conn->query("OPTIMIZE TABLE `milestones_assigned`");
$conn->query("OPTIMIZE TABLE `projectfolders`");
$conn->query("OPTIMIZE TABLE `projekte`");
$conn->query("OPTIMIZE TABLE `projekte_assigned`");
$conn->query("OPTIMIZE TABLE `roles`");
$conn->query("OPTIMIZE TABLE `roles_assigned`");
$conn->query("OPTIMIZE TABLE `settings`");
$conn->query("OPTIMIZE TABLE `tasklist`");
$conn->query("OPTIMIZE TABLE `tasks`");
$conn->query("OPTIMIZE TABLE `tasks_assigned`");
$conn->query("OPTIMIZE TABLE `timetracker`");
$conn->query("OPTIMIZE TABLE `user`");
$template->display("update.tpl");
?>