Checking configuration
0) {
print "
Some configuration tests failed. Please correct them before continuing.
";
print "
";
foreach ($errors as $error) {
print "- $error
";
}
print "
";
exit;
}
$notices = array();
if (!function_exists("curl_init")) {
array_push($notices, "It is highly recommended to enable support for CURL in PHP.");
}
if (count($notices) > 0) {
print_notice("Configuration check succeeded with minor problems:");
print "
";
foreach ($notices as $notice) {
print "- $notice
";
}
print "
";
} else {
print_notice("Configuration check succeeded.");
}
?>
Checking database
Initialize database
Before you can start using tt-rss, database needs to be initialized. Click on the button below to do that now.
Initializing database...";
$lines = explode(";", preg_replace("/[\r\n]/", "", file_get_contents("../schema/ttrss_schema_".basename($DB_TYPE).".sql")));
foreach ($lines as $line) {
if (strpos($line, "--") !== 0 && $line) {
db_query($link, $line, $DB_TYPE);
}
}
print_notice("Database initialization completed.");
} else {
print_notice("Database initialization skipped.");
}
print "
Generated configuration file
";
print "
Copy following text and save as config.php
in tt-rss main directory. It is suggested to read through the file to the end in case you need any options changed fom default values.
";
print "
After copying the file, you will be able to login with default username and password combination: admin
and password
. Don't forget to change the password immediately!
"; ?>
Saving configuration file to parent directory...";
if (!file_exists("../config.php")) {
$fp = fopen("../config.php", "w");
if ($fp) {
$written = fwrite($fp, make_config($DB_TYPE, $DB_HOST,
$DB_USER, $DB_NAME, $DB_PASS,
$DB_PORT, $SELF_URL_PATH));
if ($written > 0) {
print_notice("Successfully saved config.php. You can try
loading tt-rss now.");
} else {
print_notice("Unable to write into config.php in tt-rss directory.");
}
fclose($fp);
} else {
print_error("Unable to open config.php in tt-rss directory for writing.");
}
} else {
print_error("config.php already present in tt-rss directory, refusing to overwrite.");
}
}
?>