Prep the 1.2.4 release with:
[bugdar.git] / install / global.php
1 <?php
2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar
5 || # Copyright ©2002-2007 Blue Static
6 || #
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version 2 of the License.
10 || #
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 || # more details.
15 || #
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
21
22 error_reporting(E_ALL & ~E_NOTICE);
23
24 // ###################################################################
25 // load system
26
27 chdir('./../');
28
29 define('ISSO_MT_START', microtime());
30 define('ISSO_CHECK_POST_REFERER', 1);
31
32 require_once('./includes/version.php');
33
34 require_once('./framework/kernel.php');
35 $bugsys = new ISSO;
36 $bugsys->setAppPath(getcwd());
37 $bugsys->setApplication('Bugdar');
38 $bugsys->setAppVersion(BUGDAR_VERSION);
39
40 if (!file_exists('./includes/config.php'))
41 {
42 echo 'includes/config.php needs to be present!';
43 exit;
44 }
45
46 require_once('./includes/config.php');
47
48 $bugsys->setDebug($debug);
49
50 define('ISSO_DB_LAYER', 'db_mysql');
51 $bugsys->load('db_mysql', 'db', true);
52 $db->connect($servername, $username, $password, $database, $usepconnect);
53
54 if ($utf8)
55 {
56 $db->query("SET NAMES utf8");
57 }
58
59 // don't use sql strict mode
60 $db->query("SET sql_mode = ''");
61
62 // needed for API validation
63 $bugsys->load('functions', 'funct');
64
65 define('DEVDEBUG', $debug);
66 define('TABLE_PREFIX', $tableprefix);
67 define('COOKIE_PREFIX', $cookieprefix);
68
69 unset($database, $servername, $username, $password, $usepconnect, $tableprefix, $cookieprefix);
70
71 require_once('./includes/functions_datastore.php');
72 require_once('./includes/functions.php');
73 require_once('./includes/language.php');
74 require_once('./includes/permissions.php');
75
76 // ###################################################################
77 // init the big three
78
79 $bugsys->options = array();
80 $bugsys->userinfo = array();
81 $bugsys->datastore = array();
82
83 // ###################################################################
84
85 $bugsys->versions = array(
86 '1.0.0' => 1,
87 '1.0.1' => 2,
88 '1.1.0 Beta 1' => 3,
89 '1.1.0 Beta 2' => 4,
90 '1.1.0 Release Candidate 1' => 5,
91 '1.1.0' => 6,
92 '1.1.1' => 7,
93 '1.1.2' => 8,
94 '1.1.3' => 9,
95 '1.1.4' => 10,
96 '1.1.5' => 11,
97 '1.2.0 Beta 1' => 12,
98 '1.2.0 Beta 2' => 13,
99 '1.2.0 Beta 3' => 14,
100 '1.2.0 Release Candidate 1' => 15,
101 '1.2.0' => 16,
102 '1.2.1' => 17,
103 '1.2.2' => 18,
104 '1.2.3' => 19,
105 '1.2.4' => -1,
106 );
107
108 // ###################################################################
109
110 $bugsys->load('installer', null);
111
112 $bugsys->input_clean('mark', TYPE_UINT);
113
114 if ($bugsys->in['mark'] == STOP_MARK)
115 {
116 if (!preg_match('#^upgrade([0-9]*)\.php$#i', ACTIVE_SITE, $matches))
117 {
118 define('STOP_LINK', '<a href="../admin/">Go to the Administrative Control Panel</a>');
119 }
120 else
121 {
122 $temp = array_values($bugsys->versions);
123 if ($temp["$matches[1]"] != -1)
124 {
125 header("Location: upgrade.php");
126 }
127 else
128 {
129 define('STOP_LINK', '<a href="../admin/">Go to the Administrative Control Panel</a>');
130 }
131 }
132 }
133
134 /*=====================================================================*\
135 || ###################################################################
136 || # $HeadURL$
137 || # $Id$
138 || ###################################################################
139 \*=====================================================================*/
140 ?>