1 | <?php |
---|
2 | $stoppage = true; |
---|
3 | |
---|
4 | |
---|
5 | |
---|
6 | extract($_SESSION['sql']); |
---|
7 | $dbhost = $host; |
---|
8 | extract($_SESSION['sett']); |
---|
9 | |
---|
10 | $config = preg_replace("/\{([^\}]+)\}/e", "\\1", join('', file('config.tpl'))); |
---|
11 | $fp = fopen('../cache/config.php', 'w'); |
---|
12 | fwrite($fp, $config); |
---|
13 | fclose($fp); |
---|
14 | ?> |
---|
15 | <p>Here is the config i created for you, i saved it as ../cache/config.php with chmod 777.<br/> |
---|
16 | Please move that file to the main dir or create a new one there with the following content.<br/> |
---|
17 | You 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 |
---|
20 | highlight_string($config); |
---|
21 | ?> |
---|
22 | <?php |
---|
23 | if (!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 |
---|
32 | require_once('../config.php'); |
---|
33 | |
---|
34 | $db = mysql_pconnect(DB_HOST, DB_USER, DB_PASS); |
---|
35 | mysql_select_db(DB_NAME); |
---|
36 | |
---|
37 | $confs = file('config.data'); |
---|
38 | foreach ($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> |
---|