<?php


    /**
     * Creates a database connection using the data in the config files.
     * 
     * @return SQLite3Result Connection to the database.
     */
    function start_db(){
        global $path;
        //return new SQLiteDatabase($path["db"]);
        class SQLite extends SQLite3 {
            function __construct($file) {
                $this->open($file);
            }
        }
        $db = new SQLite3($path["db"]);
        if(!$db) {
            error_log($db->lastErrorMsg());
        }
        else {
            return $db;
        }
    }

?>
