4 $DB_CONNECTION = false;
6 // i need to figure out how i do data encapsulation here. We'll support mysql and sqlite3 off the bat if we can - sqlite3 comes first tho
7 function gwvp_dbCreateMysqlStructure()
12 function gwvp_dbCreateSQLiteStructure()
17 function gwvp_isDBSetup()
19 // for sqlite, we just check if the db exists, for everyone else, we check for a conneciton and go yay or nay
20 global $WEB_ROOT_FS, $BASE_URL, $repo_base, $data_directory, $db_type, $db_url;
22 if($db_type == "sqlite") {
23 if(file_exists($db_url)) return true;
27 // TODO now for the connectables
31 function gwvp_ConnectDB()
33 global $WEB_ROOT_FS, $BASE_URL, $repo_base, $data_directory, $db_type, $db_url;
35 // first check if $DB_CONNECTION IS live
36 if($DB_CONNECTION != false) return $DB_CONNECTION;
38 // and here we go with pdo.
40 $DB_CONNECTION = new PDO("$db_type:$db_url");
41 } catch(PDOException $exep) {
42 error_log("execpt on db open");
47 /* functions we'll need to access data:
50 * getUserData(username)
52 * getGroupData(groupname)
55 * deleteGroupMember(...)