diff --git a/README b/README index ddd178a..1ceb4cb 100644 --- a/README +++ b/README @@ -3,3 +3,16 @@ WineHQ Application Database Authors: Jeremy Newman Charles Leop + +To install locally for testing/hacking: +- Symlink from /var/www to the appdb directory +- Copy include/config.php.sample to include/config.php +- Edit include/config.php as you see fit, the default name of the database + used in the table creation step below is "apidb", you'll have to modify + these files if you change this in config.php +- cd tables, run ./create_tables to create the database tables +- Try to open up localhost/appdb, if you get a directory listing + Edit your /etc/apache/httpd.conf "DirectoryIndex" to include index.php + so apache will open index.php after not finding index.html/index.htm etc +- Check your /etc/php/php.ini to ensure that 'register_globals = On' as the + appdb uses globals and won't work correctly without this diff --git a/include/config.php.sample b/include/config.php.sample index 8c15e18..b98104a 100644 --- a/include/config.php.sample +++ b/include/config.php.sample @@ -13,7 +13,7 @@ $apidb_debug = 0; //turns debugging on/off $apidb_dbuser = "wineowner"; $apidb_dbpass = "lemonade"; $apidb_dbhost = "localhost"; -$apidb_db = "winehq_appdb"; +$apidb_db = "apidb"; /* @@ -22,6 +22,6 @@ $apidb_db = "winehq_appdb"; $userdb_dbuser = "wineowner"; $userdb_dbpass = "lemonade"; $userdb_dbhost = "localhost"; -$userdb_db = "winehq_appdb"; +$userdb_db = "apidb"; ?> diff --git a/tables/appdb_tables.sql b/tables/appdb_tables.sql index 481cd3d..446b89a 100644 --- a/tables/appdb_tables.sql +++ b/tables/appdb_tables.sql @@ -1,16 +1,25 @@ +create database if not exists apidb; + use apidb; -drop table vendor; -drop table appFamily; -drop table appVersion; -drop table userExperience; -drop table apiUsage; -drop table appCategory; -drop table appHitStats; -drop table catHitStats; -drop table appOwners; -drop table appComments; -drop table appData; +drop table if exists vendor; +drop table if exists appFamily; +drop table if exists appVersion; +drop table if exists userExperience; +drop table if exists apiUsage; +drop table if exists appCategory; +drop table if exists appHitStats; +drop table if exists catHitStats; +drop table if exists appOwners; +drop table if exists appComments; +drop table if exists appData; +drop table if exists appQueue; +drop table if exists appCrosslink; +drop table if exists appBundle; +drop table if exists appVotes; +drop table if exists appRating; +drop table if exists appNotes; +drop table if exists sessionMessages; /* diff --git a/tables/prefs_list.sql b/tables/prefs_list.sql index e06bb19..6b02725 100644 --- a/tables/prefs_list.sql +++ b/tables/prefs_list.sql @@ -1,3 +1,7 @@ +use apidb; + +drop table if exists prefs_list; + CREATE TABLE prefs_list ( id int auto_increment not null, name varchar(32), diff --git a/tables/user_list.sql b/tables/user_list.sql index 48ddfe9..751f60d 100644 --- a/tables/user_list.sql +++ b/tables/user_list.sql @@ -1,3 +1,6 @@ +use apidb; + +drop table if exists user_list; create table user_list ( stamp timestamp not null, diff --git a/tables/user_prefs.sql b/tables/user_prefs.sql index a2be08f..d3b1875 100644 --- a/tables/user_prefs.sql +++ b/tables/user_prefs.sql @@ -1,3 +1,7 @@ +use apidb; + +drop table if exists user_prefs; + CREATE TABLE user_prefs ( userid int not null, name varchar(64) not null, diff --git a/tables/user_privs.sql b/tables/user_privs.sql index 5f53557..60190d6 100644 --- a/tables/user_privs.sql +++ b/tables/user_privs.sql @@ -1,3 +1,7 @@ +use apidb; + +drop table if exists user_privs; + CREATE TABLE user_privs ( userid int not null, priv varchar(64) not null,