]>
src.bluestatic.org Git - bugdar.git/blob - install/global.php
2 /*=====================================================================*\
3 || ###################################################################
5 || # Copyright (c)2002-2007 Blue Static
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.
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
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 \*=====================================================================*/
22 error_reporting(E_ALL
& ~E_NOTICE
);
24 // ###################################################################
29 define('ISSO_MT_START', microtime());
30 define('ISSO_CHECK_POST_REFERER', 1);
32 require_once('./includes/version.php');
34 require_once('./framework/kernel.php');
36 $bugsys->setAppPath(getcwd());
37 $bugsys->setApplication('Bugdar');
38 $bugsys->setAppVersion(BUGDAR_VERSION
);
40 if (!file_exists('./includes/config.php'))
42 echo 'includes/config.php needs to be present!';
46 require_once('./includes/config.php');
48 $bugsys->setDebug($debug);
50 define('ISSO_DB_LAYER', 'db_mysql');
51 $bugsys->load('db_mysql', 'db', true);
52 $db->connect($servername, $username, $password, $database, $usepconnect);
56 $db->query("SET NAMES utf8");
59 // don't use sql strict mode
60 $db->query("SET sql_mode = ''");
62 // needed for API validation
63 $bugsys->load('functions', 'funct');
65 define('DEVDEBUG', $debug);
66 define('TABLE_PREFIX', $tableprefix);
67 define('COOKIE_PREFIX', $cookieprefix);
69 unset($database, $servername, $username, $password, $usepconnect, $tableprefix, $cookieprefix);
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');
76 // ###################################################################
79 $bugsys->options
= array();
80 $bugsys->userinfo
= array();
81 $bugsys->datastore
= array();
83 // ###################################################################
85 $bugsys->versions
= array(
90 '1.1.0 Release Candidate 1' => 5,
100 '1.2.0 Release Candidate 1' => 15,
108 // ###################################################################
110 $bugsys->load('installer', null);
112 $bugsys->input_clean('mark', TYPE_UINT
);
114 if ($bugsys->in
['mark'] == STOP_MARK
)
116 if (!preg_match('#^upgrade([0-9]*)\.php$#i', ACTIVE_SITE
, $matches))
118 define('STOP_LINK', '<a href="../admin/">Go to the Administrative Control Panel</a>');
122 $temp = array_values($bugsys->versions
);
123 if ($temp["$matches[1]"] != -1)
125 header("Location: upgrade.php");
129 define('STOP_LINK', '<a href="../admin/">Go to the Administrative Control Panel</a>');