~eventum-developers/eventum/trunk

« back to all changes in this revision

Viewing changes to upgrade/v1.3.1_to_v1.4/upgrade_config.php

  • Committer: Elan Ruusamäe
  • Date: 2009-06-27 15:00:41 UTC
  • Revision ID: glen@delfi.ee-20090627150041-mpb27al56kmprakw
- restructured

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
2
// upgrade the config.inc.php file
3
3
 
4
 
require_once(dirname(__FILE__) . "/../../../init.php");
 
4
require_once dirname(__FILE__) . '/../init.php';
5
5
 
6
6
// make backup copy
7
7
$backup_file = APP_PATH . "config.inc.pre_1_4.php";
10
10
    exit(1);
11
11
}
12
12
 
13
 
$config_contents = implode("", file(APP_PATH . "setup/config.inc.php"));
 
13
$config_contents = implode("", file(APP_PATH . "/setup/config.inc.php"));
14
14
$config_backup = $config_contents;
15
15
$config_contents = str_replace("%{APP_PATH}%", APP_PATH, $config_contents);
16
16
$config_contents = str_replace("%{APP_SQL_DBHOST}%", APP_SQL_DBHOST, $config_contents);
28
28
}
29
29
 
30
30
$config_contents = str_replace("%{PROTOCOL_TYPE}%", $protocol_type, $config_contents);
31
 
$fp = fopen(APP_PATH . 'config.inc.php', 'w');
 
31
$fp = fopen(APP_PATH . '/config.inc.php', 'w');
32
32
if ($fp === FALSE) {
33
33
    echo "Could not open the file 'config.inc.php' for writing. The permissions on the file should be set as to allow the user that the web server runs as to open it. Please correct this problem and try again.";
34
34
    exit(1);
41
41
fclose($fp);
42
42
?>
43
43
Done. Your configuration file (config.inc.php) has been upgraded to version 1.4. <br />
44
 
A backup copy has been made in the file <i>'<?php echo $backup_file; ?>'</i>.
 
 
b'\\ No newline at end of file'
 
44
A backup copy has been made in the file <i>'<?php echo $backup_file; ?>'</i>.