summaryrefslogtreecommitdiff
path: root/www/setup.php
diff options
context:
space:
mode:
authorroot2014-02-26 17:27:15 +0100
committerroot2014-02-26 17:27:15 +0100
commitf4c30ebad16c0b72aaf122dab4fb193c780e2ac9 (patch)
treee8165596b5a7cdf7deafab41503d899c2b80486f /www/setup.php
parent0718ff72472754e6116ad58f4ff6bc788f5c3d61 (diff)
downloadrandom-f4c30ebad16c0b72aaf122dab4fb193c780e2ac9.tar.gz
finished build, now it's time for the front end
Diffstat (limited to 'www/setup.php')
-rw-r--r--www/setup.php36
1 files changed, 0 insertions, 36 deletions
diff --git a/www/setup.php b/www/setup.php
deleted file mode 100644
index 79a7fdd..0000000
--- a/www/setup.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?
-
-$db = new SQLite3("../database/dict.db");
-$bool = false;
-
-foreach ($_GET as $name => $value) {
- if(preg_match("/drop(ped)?/i",$name)){
- $bool=true;
- }
-}
-
-if($bool){
- if($db->exec("
- BEGIN TRANSACTION;
- PRAGMA writable_schema = 1;
- DELETE FROM sqlite_master WHERE type = 'table';
- PRAGMA writable_schema = 0;
- COMMIT;
- VACUUM;")
- ){
- echo "dropped everything";
- } else {
- echo "error with database";
- }
-} else {
- if($db->exec("
- BEGIN TRANSACTION;
- CREATE TABLE IF NOT EXISTS english (id INTEGER PRIMARY KEY, word TEXT UIQUE);
- CREATE TABLE IF NOT EXISTS german (id INTEGER PRIMARY KEY, word TEXT UIQUE);
- COMMIT;")
- ) {
- echo "Success!";
- } else {
- echo "Failure!" ;
- }
-}