root/dev/install/install_step7.php @ 106

Revision 95, 1.6 KB (checked in by exi, 14 years ago)

Added Logout option to admin menu.
Autoupgrade now checks for index rather than just creating it.
Fixed that no system error for contracts during upgrade.
Added a warning to the installer in case it doesnt get any id on step5.

Line 
1<?php
2$stoppage = true;
3
4
5
6extract($_SESSION['sql']);
7$dbhost = $host;
8extract($_SESSION['sett']);
9
10$config = preg_replace("/\{([^\}]+)\}/e", "\\1", join('', file('config.tpl')));
11$fp = fopen('../cache/config.php', 'w');
12fwrite($fp, trim($config));
13fclose($fp);
14?>
15<p>Here is the config i created for you, i saved it as ../cache/config.php with chmod 777.<br/>
16Please move that file to the main dir or create a new one there with the following content.<br/>
17You can continue once that config exists, i will try to delete the generated config if it should be stil there on the next step.<br/>
18</p>
19<?php
20highlight_string($config);
21?>
22<?php
23if (!file_exists('../config.php'))
24{
25    ?>
26<p><a href="?step=<?php echo $_SESSION['state']; ?>">Refresh</a></p>
27<?php
28    return;
29}
30// config is there, use it to create all config vars which arent there
31// to prevent that ppl with running installs get new values
32require_once('../config.php');
33
34$db = mysql_pconnect(DB_HOST, DB_USER, DB_PASS);
35mysql_select_db(DB_NAME);
36
37$confs = file('config.data');
38foreach ($confs as $line)
39{
40    list($key, $value) = explode(chr(9), trim($line));
41    $result = mysql_query('select * from kb3_config where cfg_site=\''.KB_SITE.'\' and cfg_key=\''.$key.'\'');
42    if (!$row = mysql_fetch_row($result))
43    {
44        $sql = "insert into kb3_config values ('".KB_SITE."','".$key."','".$value."')";
45        mysql_query($sql);
46    }
47}
48?>
49<br/><br/><font size=+1>Found the config on the right place, please continue...</font><br/>
50<p><a href="?step=<?php echo ($_SESSION['state']+1); ?>">Next Step</a></p>
Note: See TracBrowser for help on using the browser.