r756: Adding upgrade system
[bugdar.git] / install / global.php
1 <?php
2 /*=====================================================================*\
3 || ################################################################### ||
4 || # Bugdar [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
7 || # This file may not be reproduced in any way without permission. # ||
8 || # --------------------------------------------------------------- # ||
9 || # User License Agreement at http://www.iris-studios.com/license/ # ||
10 || ################################################################### ||
11 \*=====================================================================*/
12
13 error_reporting(E_ALL & ~E_NOTICE);
14
15 // ###################################################################
16 // load system
17
18 chdir('./../');
19
20 define('ISSO_MT_START', microtime());
21
22 if (!file_exists('./includes/config.php'))
23 {
24 echo 'includes/config.php needs to be present!';
25 exit;
26 }
27
28 require_once('./includes/config.php');
29 $thepass = $password; // darn register_globals
30
31 define('ISSO_ESCAPE_STRINGS', 1);
32 define('ISSO_CHECK_POST_REFERER', 1);
33
34 require_once($pathtoisso . 'kernel.php');
35 $bugsys =& $_isso;
36 $bugsys->application = 'Bugdar';
37 $bugsys->apppath = $bugsys->fetch_sourcepath(getcwd());
38 $bugsys->appversion = '[#]version[#]';
39 $bugsys->debug = $debug;
40 $bugsys->sourcepath = $bugsys->fetch_sourcepath($pathtoisso);
41
42 $bugsys->load('db_mysql');
43 $db->database = $database;
44 $db->connect($servername, $username, $thepass, $usepconnect);
45
46 $bugsys->exec_sanitize_data();
47
48 define('DEVDEBUG', $debug);
49 define('TABLE_PREFIX', $tableprefix);
50 define('COOKIE_PREFIX', $cookieprefix);
51
52 unset($database, $servername, $username, $password, $usepconnect, $tableprefix, $cookieprefix);
53
54 require_once('./includes/functions_datastore.php');
55 require_once('./includes/functions.php');
56
57 // ###################################################################
58 // init the big three
59 $bugsys->options = array();
60 $bugsys->userinfo = array();
61 $bugsys->datastore = array();
62
63 // ###################################################################
64
65 $bugsys->versions = array(
66 '1.0.0' => 1,
67 '1.0.1' => -1
68 );
69
70 // ###################################################################
71
72 $bugsys->in['mark'] = intval($bugsys->in['mark']);
73
74 // ###################################################################
75 // ###################################################################
76 // ###################################################################
77
78 // ###################################################################
79 // constructs the page header bit
80
81 function page_start()
82 {
83 ?>
84 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
85 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
86 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
87 <head>
88 <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
89 <link rel="stylesheet" href="install.css" media="screen" />
90 <title>Bugdar Installer</title>
91 </head>
92 <body>
93
94 <?php
95 }
96
97 // ###################################################################
98 // puts the end of the page down
99
100 function page_end($next = true)
101 {
102 global $bugsys;
103
104 if (defined('STOP_MARK') AND $next)
105 {
106 if ($bugsys->in['mark'] >= STOP_MARK)
107 {
108 echo '<div class="buttonlink"><a href="../admin/">Go to the Administrative Control Panel</a></div>';
109 }
110 else
111 {
112 echo '<div class="buttonlink"><a href="' . ACTIVE_SITE . '?mark=' . ($bugsys->in['mark'] + 1) . '">Next Step</a></div>';
113 }
114 }
115
116 echo '
117
118 </body>
119
120 </html>';
121
122 exit;
123 }
124
125 /*=====================================================================*\
126 || ###################################################################
127 || # $HeadURL$
128 || # $Id$
129 || ###################################################################
130 \*=====================================================================*/
131 ?>