Created a new variable in config.php and settings.php for the SQLite file

balu-master
David 12 years ago
parent 982b704f69
commit 0e53c7a7c1

@ -146,7 +146,7 @@ function write_config_file($dbt, $dbh, $dbn, $dbu, $dbp) {
$cfg_content .= " // Database connection credentials\n";
$cfg_content .= " // \n";
$cfg_content .= " define(\"SQLITE_FILE\", \"weave_db\");\n";
if ( $dbt != "mysql" ) {
$cfg_content .= " define(\"MYSQL_ENABLE\", false);\n";
$cfg_content .= " define(\"MYSQL_HOST\", \"localhost\");\n";
@ -229,7 +229,7 @@ function print_mysql_connection_form() {
// check if we have no configuration at the moment
//
if ( file_exists("settings.php") && filesize( "settings.php" ) > 0 ) {
echo "<hr><h2>The setup looks like it's completed, else please delete settings.php</h2><hr>";
echo "<hr><h2>The setup looks like it's completed, please delete settings.php</h2><hr>";
exit;
}
@ -319,8 +319,7 @@ if ( $action == "step2" ) {
if ( file_exists($db_name) && filesize( $db_name ) > 0 ) {
$dbInstalled = true;
} else {
// echo("Creating sqlite weave storage: DBname". $db_name ." | username: ". $username);
// echo("<br>");
echo("Creating sqlite weave storage: ". $db_name ."<br>");
$dbHandle = new PDO('sqlite:' . $db_name);
$dbHandle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}

@ -58,7 +58,7 @@ class WeaveStorage
if ( ! MYSQL_ENABLE )
{
$path = explode('/', $_SERVER['SCRIPT_FILENAME']);
$db_name = 'weave_db';
$db_name = SQLITE_FILE;
array_pop($path);
array_push($path, $db_name);
$db_name = implode('/', $path);

Loading…
Cancel
Save