function check_database()
{
- if($db = sqlite_open(DB_FILENAME))
+ $db_exists = FALSE;
+
+ if(file_exists(DB_FILENAME) AND $db = sqlite_open(DB_FILENAME))
{
+ $db_exists = TRUE;
+
//initialize db
if (db_table_exists ($db, 'packages') === FALSE)
{
sqlite_close($db);
}
+
+ return $db_exists;
}
require_once 'includes/config.inc';
require_once 'includes/functions.inc';
-check_database();
+if(!check_database())
+{
+ die("Database not found and cannot be created.");
+}
$name = '';
Description: IPv4 link-local address allocator
*/
-check_database();
+if(!check_database())
+{
+ die("Database not found and cannot be created.");
+}
$feeds = db_query("SELECT f_id, f_name, f_uri FROM feeds");