[pLog-svn] r3122 - in plog/trunk: . install templates/wizard

oscar at devel.lifetype.net oscar at devel.lifetype.net
Sat Mar 25 15:46:57 GMT 2006


Author: oscar
Date: 2006-03-25 15:46:56 +0000 (Sat, 25 Mar 2006)
New Revision: 3122

Added:
   plog/trunk/install/changes_10_11.properties.php
   plog/trunk/install/defaultconfig.properties.php
   plog/trunk/templates/wizard/checks.template
Modified:
   plog/trunk/install/dbschemas.properties.php
   plog/trunk/wizard.php
Log:
added an initial step for the wizard to make some checks. Right now it checks some files and folders to see if they're writable, if there is suppotr for xml, mysql and sessions and if the safe mode is enabled. More checks can be easily added by extending one class and adding teh new class to an array, and the code will take care of the rest. 

I've also moved the db schema and the rows that need to be inserted in the config table to their own files under the install/ table, to make the code in wizard.php look a bit more tidy.


Added: plog/trunk/install/changes_10_11.properties.php
===================================================================
--- plog/trunk/install/changes_10_11.properties.php	2006-03-24 21:24:50 UTC (rev 3121)
+++ plog/trunk/install/changes_10_11.properties.php	2006-03-25 15:46:56 UTC (rev 3122)
@@ -0,0 +1,45 @@
+<?php
+
+$Changes["Deletions"] = Array(
+    "ALTER TABLE {dbprefix}articles DROP COLUMN category_id",
+    "ALTER TABLE {dbprefix}blogs DROP COLUMN show_in_summary",
+);
+
+$Changes["Articles"] = Array(    
+    "ALTER TABLE {dbprefix}articles ADD COLUMN num_comments INTEGER(10) NOT NULL DEFAULT 0",
+    "ALTER TABLE {dbprefix}articles ADD COLUMN num_nonspam_comments INTEGER(10) NOT NULL DEFAULT 0",
+    "ALTER TABLE {dbprefix}articles ADD COLUMN num_trackbacks INTEGER(10) NOT NULL DEFAULT 0",
+    "ALTER TABLE {dbprefix}articles ADD COLUMN num_nonspam_trackbacks INTEGER(10) NOT NULL DEFAULT 0",
+    "ALTER TABLE {dbprefix}articles ADD COLUMN global_category_id INTEGER(10) NOT NULL DEFAULT 0",
+    "ALTER TABLE {dbprefix}articles ADD COLUMN in_summary_page TINYINT(10) NOT NULL DEFAULT 1", 
+    "ALTER TABLE {dbprefix}articles ADD COLUMN modification_date TIMESTAMP(14) NOT NULL"
+);
+$Changes["Article Categories"] = Array(
+    "ALTER TABLE {dbprefix}articles_categories ADD COLUMN num_articles INTEGER(10) NOT NULL DEFAULT 0",
+    "ALTER TABLE {dbprefix}articles_categories ADD COLUMN num_published_articles INTEGER(10) NOT NULL DEFAULT 0"
+);
+$Changes["Article Comments"] = Array(
+    "ALTER TABLE {dbprefix}articles_comments ADD COLUMN type INTEGER(2) NOT NULL DEFAULT 1",
+    "ALTER TABLE {dbprefix}articles_comments ADD COLUMN blog_id INTEGER(10) NOT NULL DEFAULT 0",
+);
+$Changes["Blogs"] = Array(
+    "ALTER TABLE {dbprefix}blogs ADD COLUMN create_date TIMESTAMP(14)",
+    "ALTER TABLE {dbprefix}blogs ADD COLUMN last_update_date TIMESTAMP(14)",
+    "ALTER TABLE {dbprefix}blogs ADD COLUMN num_posts INT(10) NOT NULL DEFAULT 0",
+    "ALTER TABLE {dbprefix}blogs ADD COLUMN num_comments INT(10) NOT NULL DEFAULT 0",    
+    "ALTER TABLE {dbprefix}blogs ADD COLUMN num_trackbacks INT(10) NOT NULL DEFAULT 0",
+    "ALTER TABLE {dbprefix}blogs ADD COLUMN show_in_summary INT(4) NOT NULL DEFAULT 1",
+    "ALTER TABLE {dbprefix}blogs ADD COLUMN blog_category_id INT(4) NOT NULL DEFAULT 0"    
+);
+$Changes["Gallery Albums"] = Array(
+    "ALTER TABLE {dbprefix}gallery_albums ADD COLUMN num_resources INT(10)",
+    "ALTER TABLE {dbprefix}gallery_albums ADD COLUMN num_children INT(10)"
+);
+$Changes["Links Categories"] = Array(
+    "ALTER TABLE {dbprefix}mylinks_categories ADD COLUMN num_links INT(10)"
+);
+$Changes["Users"] = Array(
+    "ALTER TABLE {dbprefix}users ADD COLUMN site_admin INT(10)"
+);
+
+?>
\ No newline at end of file

Modified: plog/trunk/install/dbschemas.properties.php
===================================================================
--- plog/trunk/install/dbschemas.properties.php	2006-03-24 21:24:50 UTC (rev 3121)
+++ plog/trunk/install/dbschemas.properties.php	2006-03-25 15:46:56 UTC (rev 3122)
@@ -1,258 +1,395 @@
 <?php
 
-/**
- * main articles table
- */
-$Tables["articles"] = "
-  id I(10) NOTNULL AUTO PRIMARY
-  category_id I(10) NOTNULL DEFAULT 0,
-  topic X NOTNULL DEFAULT '',
-  text X NOTNULL DEFAULT '',
-  date T DEFDATE,
-  modification_date T,
-  user_id I(10) NOTNULL DEFAULT 0,
-  blog_id I(10) NOTNULL DEFAULT 0,
-  status I(10) NOTNULL DEFAULT 1,
-  num_reads I(10) NOTNULL DEFAULT 0,
-  properties X NOTNULL DEFAULT '',
-  normalized_topic X NOTNULL DEFAULT '',
-  normalized_text X NOTNULL DEFAULT '',
-  mangled_topic X NOTNULL DEFAULT '',
-  slug C(255) NOTNULL DEFAULT ''
-";
+    $Tables[0]["desc"] = "Articles";
+    $Tables[0]["code"] = "CREATE TABLE {dbprefix}articles (
+  id int(10) unsigned NOT NULL auto_increment,
+  category_id int(10) unsigned NOT NULL default '0',
+  date timestamp(14) NOT NULL,
+  modification_date timestamp(14) NOT NULL,
+  user_id int(10) unsigned NOT NULL default '0',
+  blog_id int(10) unsigned NOT NULL default '0',
+  status INTEGER(5) NOT NULL default 1,
+  num_reads int(10) default '0',
+  properties TEXT NOT NULL default '',
+  slug varchar(255) NOT NULL,
+  num_comments int(10) NOT NULL default '0', 
+  num_nonspam_comments int(10) NOT NULL default '0', 
+  num_trackbacks int(10) NOT NULL default '0',
+  num_nonspam_trackbacks int(10) NOT NULL default '0',
+  global_category_id int(10) NOT NULL default '0',
+  in_summary_page TINYINT(1) NOT NULL DEFAULT '1',  
+  PRIMARY KEY (id),
+  KEY num_reads (num_reads),
+  KEY category_id (category_id),
+  KEY blog_id (blog_id),
+  KEY user_id (user_id),
+  KEY slug (slug),
+  KEY blog_id_slug (blog_id,slug),
+  KEY blog_id_slug_category_id (blog_id,slug,category_id)
+) TYPE=MyISAM;";
+
+    $Tables[1]["desc"] = "Article categories";
+    $Tables[1]["code"] = "CREATE TABLE {dbprefix}articles_categories (
+  id int(10) unsigned NOT NULL auto_increment,
+  name varchar(255) NOT NULL default '',
+  url varchar(255) NOT NULL default '',
+  blog_id int(10) unsigned NOT NULL default '0',
+  last_modification timestamp(14) NOT NULL,
+  in_main_page TINYINT(1) NOT NULL DEFAULT '1',
+  parent_id INTEGER(10) NOT NULL DEFAULT '0',
+  description TEXT NOT NULL DEFAULT '',
+  properties text NOT NULL default '',
+  mangled_name varchar(255) NOT NULL default '',
+  num_articles int(10) NOT NULL default 0,
+  num_published_articles int(10) NOT NULL default 0,
+  PRIMARY KEY  (id),
+  KEY parent_id (parent_id),
+  KEY blog_id (blog_id),
+  KEY mangled_name (mangled_name)
+) TYPE=MyISAM;";
+
+    $Tables[2]["desc"] = "Comments";
+    $Tables[2]["code"] = "CREATE TABLE {dbprefix}articles_comments (
+  id int(10) unsigned NOT NULL auto_increment,
+  article_id int(10) unsigned NOT NULL default '0',
+  blog_id int(10) unsigned NOT NULL default '0',
+  topic text NOT NULL,
+  text text,
+  date timestamp(14) NOT NULL,
+  user_email varchar(255) default '',
+  user_url varchar(255) default '',
+  user_name varchar(255) NOT NULL default 'Anonymous',
+  parent_id int(10) unsigned default '0',
+  client_ip varchar(15) default '0.0.0.0',
+  send_notification tinyint(1) default '0',
+  status tinyint(2) default '1',
+  spam_rate float default '0',
+  properties TEXT NOT NULL DEFAULT '',
+  normalized_text TEXT NOT NULL DEFAULT '',
+  normalized_topic TEXT NOT NULL DEFAULT '',
+  type int(3) NOT NULL DEFAULT '0',  
+  PRIMARY KEY  (id),
+  KEY parent_id (parent_id),
+  KEY article_id (article_id),
+  KEY blog_id (blog_id),
+  KEY article_id_blog_id(article_id,blog_id),
+  FULLTEXT KEY normalized_fields (normalized_text,normalized_topic),
+  FULLTEXT KEY normalized_text (normalized_text),
+  FULLTEXT KEY normalized_topic (normalized_topic)
+) TYPE=MyISAM;";
+
+    $Tables[3]["desc"] = "Notifications";
+    $Tables[3]["code"] = "CREATE TABLE {dbprefix}articles_notifications (
+  id int(10) NOT NULL auto_increment,
+  blog_id int(10) NOT NULL default '0',
+  user_id int(10) NOT NULL default '0',
+  article_id int(10) NOT NULL default '0',
+  PRIMARY KEY  (id),
+  KEY article_id (article_id),
+  KEY user_id (user_id),
+  KEY blog_id (blog_id)
+) TYPE=MyISAM;";
+
+    $Tables[4]["desc"] = "Blogs";
+    $Tables[4]["code"] = "CREATE TABLE {dbprefix}blogs (
+  id int(10) unsigned NOT NULL auto_increment,
+  blog varchar(50) NOT NULL default '',
+  owner_id int(10) unsigned NOT NULL default '0',
+  blog_category_id int(10) unsigned NOT NULL default '0',
+  about text,
+  settings text NOT NULL,
+  mangled_blog varchar(50) NOT NULL default '',
+  status int(4) NOT NULL default '1',
+  show_in_summary int(4) not null default '1',
+  create_date TIMESTAMP(14) NOT NULL,
+  last_update_date TIMESTAMP(14) NOT NULL,
+  num_posts int(10) NOT NULL DEFAULT '0',
+  num_comments int(10) NOT NULL DEFAULT '0',
+  num_trackbacks int(10) NOT NULL DEFAULT '0',
+  PRIMARY KEY  (id),
+  KEY owner_id (owner_id),
+  KEY mangled_blog (mangled_blog),
+  KEY blog_category_id(blog_category_id)
+) TYPE=MyISAM;";
+
+    $Tables[5]["desc"] = "MyLinks";
+    $Tables[5]["code"] = "CREATE TABLE {dbprefix}mylinks (
+  id int(10) unsigned NOT NULL auto_increment,
+  category_id int(10) unsigned NOT NULL default '0',
+  url varchar(255) NOT NULL default '',
+  name varchar(100) default '',
+  description text NOT NULL,
+  blog_id int(10) unsigned NOT NULL default '0',
+  rss_feed varchar(255) not null default '',
+  date timestamp(14) not null,
+  properties TEXT NOT NULL DEFAULT '',
+  PRIMARY KEY  (id),
+  KEY blog_id (blog_id),
+  KEY category_id (category_id)
+) TYPE=MyISAM;";
+
+    $Tables[6]["desc"] = "MyLinks Categories";
+    $Tables[6]["code"] = "CREATE TABLE {dbprefix}mylinks_categories (
+  id int(10) NOT NULL auto_increment,
+  name varchar(100) NOT NULL default '',
+  blog_id int(10) NOT NULL default '0',
+  last_modification timestamp(14) NOT NULL,
+  properties TEXT NOT NULL DEFAULT '',
+  num_links int(10) NOT NULL default '0',
+  PRIMARY KEY  (id),
+  KEY blog_id (blog_id)
+) TYPE=MyISAM;";
+
+    $Tables[9]["desc"] = "Permissions";
+    $Tables[9]["code"] = "CREATE TABLE {dbprefix}permissions (
+  id int(10) unsigned NOT NULL auto_increment,
+  permission varchar(25) NOT NULL default '',
+  description varchar(100) NOT NULL default '',
+  PRIMARY KEY  (id)
+) TYPE=MyISAM;";
+
+    $Tables[10]["desc"] = "Referrers";
+    $Tables[10]["code"] = "CREATE TABLE {dbprefix}referers (
+  id int(10) NOT NULL auto_increment,
+  url text NOT NULL,
+  article_id int(10) NOT NULL default '0',
+  blog_id int(10) NOT NULL default '0',
+  hits int(10) default '1',
+  last_date timestamp(14),
+  PRIMARY KEY  (id),
+  KEY article_id (article_id),
+  KEY blog_id (blog_id),
+  KEY blog_id_article_id (blog_id, article_id)
+) TYPE=MyISAM;";
+
+    $Tables[12]["desc"] = "Users";
+    $Tables[12]["code"] = "CREATE TABLE {dbprefix}users (
+  id int(10) unsigned NOT NULL auto_increment,
+  user varchar(15) NOT NULL default '',
+  password varchar(32) NOT NULL default '',
+  email varchar(255) NOT NULL default '',
+  full_name varchar(255) NOT NULL default '',
+  about text,
+  properties TEXT NOT NULL default '',
+  status integer(4) NOT NULL DEFAULT 1,
+  resource_picture_id integer(10) NOT NULL DEFAULT 0,
+  site_admin int(10) NOT NULL default '0',
+  PRIMARY KEY  (id),
+  UNIQUE KEY user (user)
+) TYPE=MyISAM;";
+
+    $Tables[13]["desc"] = "Permissions";
+    $Tables[13]["code"] = "CREATE TABLE {dbprefix}users_permissions (
+  id int(10) unsigned NOT NULL auto_increment,
+  user_id int(10) unsigned NOT NULL default '0',
+  blog_id int(10) unsigned NOT NULL default '0',
+  permission_id int(10) unsigned NOT NULL default '0',
+  PRIMARY KEY  (id),
+  KEY user_id (user_id),
+  KEY blog_id (blog_id),
+  KEY user_id_permission_id (user_id,permission_id)
+) TYPE=MyISAM;";
+
+
+   $Tables[14]["desc"] = "Configuration";
+   $Tables[14]["code"] = "CREATE TABLE {dbprefix}config (
+   id int(10) NOT NULL auto_increment,
+   config_key varchar(255) NOT NULL default '',
+   config_value text NOT NULL,
+   value_type int(3) default '0',
+   PRIMARY KEY  (id,config_key)
+   ) TYPE=MyISAM;";
+
+   $Tables[15]["desc"] = "Filtered Content";
+   $Tables[15]["code"] = "CREATE TABLE {dbprefix}filtered_content (
+   id int(10) NOT NULL auto_increment,
+   reg_exp text,
+   blog_id int(10) NOT NULL default '0',
+   reason text,
+   date timestamp(14) NOT NULL,
+   PRIMARY KEY  (id),
+   KEY blog_id (blog_id)
+   ) TYPE=MyISAM;";
+
+   $Tables[16]["desc"] = "Blocked content";
+   $Tables[16]["code"] = "CREATE TABLE {dbprefix}host_blocking_rules (
+   id int(10) NOT NULL auto_increment,
+   reason text,
+   date timestamp(14) NOT NULL,
+   blog_id int(10) NOT NULL default '0',
+   block_type int(1) default '1',
+   list_type int(1) default '1',
+   mask int(2) default '0',
+   host varchar(15) default '0.0.0.0',
+   PRIMARY KEY  (id),
+   KEY blog_id (blog_id)
+   ) TYPE=MyISAM;";
+
+   $Tables[17]["desc"] = "Gallery Resources";
+   $Tables[17]["code"] = "CREATE TABLE {dbprefix}gallery_resources (
+   id int(10) NOT NULL auto_increment,
+   owner_id int(10) NOT NULL default '0',
+   album_id int(10) NOT NULL default '0',
+   description text,
+   date timestamp(14) NOT NULL,
+   flags int(10) default '0',
+   resource_type int(3) default NULL,
+   file_path varchar(255) default '',
+   file_name varchar(255) default '',
+   file_size int(20) not null default 0,
+   metadata text,
+   thumbnail_format varchar(4) not null default 'same',
+   normalized_description text NOT NULL default '',
+   properties TEXT NOT NULL DEFAULT '',
+   PRIMARY KEY  (id),
+   KEY album_id (album_id),
+   KEY owner_id (owner_id),
+   KEY file_name (file_name),
+   KEY album_id_owner_id (album_id, owner_id),
+   KEY resource_type (resource_type),
+   FULLTEXT KEY normalized_description (normalized_description)
+   ) TYPE=MyISAM;";
+
+   $Tables[18]["desc"] = "Gallery Albums";
+   $Tables[18]["code"] = "CREATE TABLE {dbprefix}gallery_albums (
+   id int(10) NOT NULL auto_increment,
+   owner_id int(10) NOT NULL default '0',
+   description text NOT NULL,
+   name varchar(255) NOT NULL default '',
+   flags int(10) NOT NULL default '0',
+   parent_id int(10) NOT NULL default '0',
+   date timestamp(14) NOT NULL,
+   properties text NOT NULL DEFAULT '',
+   show_album TINYINT(1) DEFAULT 1,
+   normalized_description text NOT NULL default '',
+   normalized_name varchar(255) NOT NULL default '',
+   mangled_name varchar(255) NOT NULL default '',
+   num_resources int(10) NOT NULL default '0',
+   num_children int(10) NOT NULL default '0',
+   PRIMARY KEY  (id),
+   KEY parent_id (parent_id),
+   KEY owner_id (owner_id),
+   KEY mangled_name (mangled_name),
+   KEY owner_id_mangled_name (owner_id, mangled_name),
+   FULLTEXT KEY normalized_name (normalized_name),
+   FULLTEXT KEY normalized_description (normalized_description),
+   FULLTEXT KEY normalized_fields (normalized_name, normalized_description)
+   ) TYPE=MyISAM;";
+
+   $Tables[19]["desc"] = "Bayesian Filter data table";
+   $Tables[19]["code"] = "CREATE TABLE {dbprefix}bayesian_filter_info (
+   id int(10) unsigned NOT NULL auto_increment,
+   blog_id int(10) unsigned default NULL,
+   total_spam int(10) unsigned default NULL,
+   total_nonspam int(10) unsigned default NULL,
+   PRIMARY KEY  (id),
+   KEY blog_id (blog_id)
+   ) TYPE=MyISAM;";
+
+   $Tables[20]["desc"] = "Bayesian Filter Information";
+   $Tables[20]["code"] = "CREATE TABLE {dbprefix}bayesian_tokens (
+   id int(10) unsigned NOT NULL auto_increment,
+   blog_id int(10) unsigned default NULL,
+   token char(100) default NULL,
+   spam_occurrences int(10) unsigned default NULL,
+   nonspam_occurrences int(10) unsigned default NULL,
+   prob float default NULL,
+   PRIMARY KEY  (id),
+   KEY blog_id (blog_id),
+   KEY token (token)
+   ) TYPE=MyISAM;";
+
+   $Tables[21]["desc"] = "Map of categories to articles";
+   $Tables[21]["code"] = "CREATE TABLE {dbprefix}article_categories_link(
+   article_id int(10) NOT NULL,
+   category_id int(10) NOT NULL,
+   PRIMARY KEY (article_id, category_id)
+   ) TYPE=MyISAM;";
+
+   $Tables[22]["desc"] = "Definition of custom fields";
+   $Tables[22]["code"] = "CREATE TABLE {dbprefix}custom_fields_definition (
+   id int(10) NOT NULL auto_increment,
+   field_name varchar(255) NOT NULL default '',
+   field_description text NOT NULL,
+   field_type int(2) NOT NULL default '1',
+   blog_id int(10) NOT NULL default '0',
+   date TIMESTAMP(14),
+   searchable TINYINT(1) default 1,
+   hidden TINYINT(1) default 1,
+   PRIMARY KEY  (id,field_name),
+   KEY blog_id (blog_id)
+   ) TYPE=MyISAM;";
+
+   $Tables[23]["desc"] = "Custom fields that have been assigned to articles";
+   $Tables[23]["code"] = "CREATE TABLE {dbprefix}custom_fields_values (
+   id int(10) NOT NULL auto_increment,
+   field_id int(10) NOT NULL default '0',
+   field_value text NOT NULL,
+   normalized_value text NOT NULL,
+   blog_id int(10) default NULL,
+   article_id int(10) default NULL,
+   PRIMARY KEY  (id),
+   FULLTEXT KEY normalized_value (normalized_value),
+   KEY blog_id (blog_id),
+   KEY article_id (article_id),
+   KEY field_id (field_id),
+   KEY blog_id_article_id (blog_id, article_id)
+   ) TYPE=MyISAM;";
+
+   $Tables[24]["desc"] = "Text of the articles";
+   $Tables[24]["code"] = "CREATE TABLE {dbprefix}articles_text (
+   id int(10) NOT NULL auto_increment,
+   article_id int(10) NOT NULL DEFAULT 0,
+   text TEXT NOT NULL DEFAULT '',
+   topic TEXT NOT NULL DEFAULT '',
+   normalized_text TEXT NOT NULL DEFAULT '',
+   normalized_topic TEXT NOT NULL DEFAULT '',
+   mangled_topic text NOT NULL,
+   PRIMARY KEY (id),
+   KEY article_id (article_id),
+   FULLTEXT KEY normalized_text (normalized_text),
+   FULLTEXT KEY normalized_topic (normalized_topic),
+   FULLTEXT KEY normalized_fields (normalized_text, normalized_topic)
+   ) TYPE=MyISAM;";
+   
+   $Tables[25]["desc"] = "PhpBB2 User Integration Table";
+   $Tables[25]["code"] = "CREATE TABLE {dbprefix}phpbb2_users (
+   id int(10) unsigned NOT NULL auto_increment,
+   phpbb_id int(10) unsigned NOT NULL,
+   full_name varchar(255) NOT NULL default '',
+   about text,
+   properties TEXT NOT NULL default '',
+   resource_picture_id integer(10) NOT NULL DEFAULT 0,
+   status INTEGER(10) NOT NULL DEFAULT 0,
+   PRIMARY KEY  (id),
+   UNIQUE KEY phpbb_id(phpbb_id)
+   ) TYPE=MyISAM;";
+   
+   /*** new in 1.1 ***/   
+   $Tables[26]["desc"] = "Blog categories";
+   $Tables[26]["code"] = "CREATE TABLE {dbprefix}blog_categories (
+   id int(10) unsigned NOT NULL auto_increment,
+   name varchar(255) NOT NULL default '',
+   description varchar(255) NOT NULL default '',
+   mangled_name varchar(255) NOT NULL default '',
+   properties TEXT NOT NULL DEFAULT '',
+   num_blogs int(10) NOT NULL default '0',
+   num_active_blogs int(10) NOT NULL default '0',
+   PRIMARY KEY (id),
+   KEY mangled_name(mangled_name)
+   ) TYPE=MyISAM;";
+   
+   $Tables[27]["desc"] = "Global Article categories";
+   $Tables[27]["code"] = "CREATE TABLE {dbprefix}global_articles_categories (
+   id int(10) unsigned NOT NULL auto_increment,
+   name varchar(255) NOT NULL default '',
+   description varchar(255) NOT NULL default '',
+   mangled_name varchar(255) NOT NULL default '',
+   properties TEXT NOT NULL DEFAULT '',
+   num_articles int(10) NOT NULL default '0',
+   num_active_articles int(10) NOT NULL default '0',
+   PRIMARY KEY (id),
+   KEY mangled_name(mangled_name)
+   ) TYPE=MyISAM;";
 
-$Tables["articles_categories"] = "
-  id I(10) NOTNULL AUTO PRIMARY,
-  name C(255) NOTNULL DEFAULT '',
-  url C(255) NOTNULL DEFAULT '',
-  blog_id I(10) NOTNULL DEFAULT 0,
-  last_modification T,
-  in_main_page L NOTNULL DEFAULT 1,
-  parent_id I(10) NOTNULL DEFAULT 0,
-  description X NOTNULL DEFAULT '',
-  properties X NOTNULL DEFAULT '',
-  mangled_name C(255) NOTNULL DEFAULT ''
-";
-
-$Tables["articles_comments"] = "
-  id I(10) NOTNULL AUTO PRIMARY,
-  article_id I(10) NOTNULL AUTO PRIMARY,
-  topic X NOTNULL DEFAULT '',
-  text X NOTNULL DEFAULT '',
-  date T,
-  user_email C(255) DEFAULT '',
-  user_name C(255) NOTNULL DEFAULT '',
-  parent_id I(10) DEFAULT 0,
-  client_ip C(15) NOTNULL DEFAULT '0.0.0.0',
-  send_notification L NOTNULL DEFAULT 1,
-  status I(4) NOTNULL DEFAULT 1,
-  spam_rate F DEFAULT 0,
-  properties X NOTNULL DEFAULT '',
-  normalized_text X NOTNULL DEFAULT '',
-  normalized_topic X NOTNULL DEFAULT ''
-";
-
-$Tables["articles_notifications"] = "
-  id I(10) NOTNULL AUTO PRIMARY,
-  blog_id I(10) NOTNULL DEFAULT '0',
-  user_id I(10) NOTNULL DEFAULT '0',
-  article_id I(10) NOTNULL DEFAULT '0'
-";
-
-$Tables["blogs"] = "
-  id I(10) NOTNULL AUTO PRIMARY,
-  blog C(50) NOTNULL DEFAULT '',
-  owner_id I(10) NOTNULL DEFAULT '0',
-  about X,
-  settings X NOTNULL DEFAULT '',
-  mangled_blog C(50) NOTNULL DEFAULT '',
-  status I(4) NOTNULL DEFAULT '1'
-";
-
-$Tables["mylinks"] = "
-  id I(10) NOTNULL AUTO PRIMARY,
-  category_id I(10) NOTNULL DEFAULT '0',
-  url C(255) NOTNULL DEFAULT '',
-  name C(100) DEFAULT '',
-  description X NOTNULL,
-  blog_id I(10)  NOTNULL DEFAULT '0',
-  rss_feed C(255) NOTNULL DEFAULT '',
-  date T(14) NOTNULL,
-  properties X NOTNULL DEFAULT ''
-";
-
-$Tables["mylinks_categories"] = "
-  id I(10) NOTNULL AUTO PRIMARY,
-  name C(100) NOTNULL DEFAULT '',
-  blog_id I(10) NOTNULL DEFAULT '0',
-  last_modification T(14) NOTNULL,
-  properties TEXT NOTNULL DEFAULT ''
-";
-
-$Tables["myrecent"] = "
-  id I(10)  NOTNULL AUTO PRIMARY,
-  category_id I(10)  NOTNULL DEFAULT '0',
-  name C(255) NOTNULL DEFAULT '',
-  text X NOTNULL,
-  user_id I(10)  NOTNULL DEFAULT '0',
-  blog_id I(10)  NOTNULL DEFAULT '0'
-";
-
-$Tables["myrecent_categories"] = "
-  id I(10)  NOTNULL AUTO PRIMARY,
-  name C(255) NOTNULL DEFAULT '',
-  blog_id I(10)  NOTNULL DEFAULT '0',
-  last_modification T(14) NOTNULL
-";
-
-$Tables["permissions"] = "
-  id I(10)  NOTNULL AUTO PRIMARY,
-  permission C(25) NOTNULL DEFAULT '',
-  description C(100) NOTNULL DEFAULT ''
-";
-
-$Tables["referers"] = "
-  id I(10) NOTNULL AUTO PRIMARY,
-  url X NOTNULL,
-  article_id I(10) NOTNULL DEFAULT '0',
-  blog_id I(10) NOTNULL DEFAULT '0',
-  hits I(10) DEFAULT '1',
-  last_date T(14)
-";
-
-$Tables["trackbacks"] = "
-  id I(10) NOTNULL AUTO PRIMARY,
-  url X NOTNULL,
-  title C(255) DEFAULT '',
-  article_id I(10) NOTNULL DEFAULT '0',
-  excerpt C(255) DEFAULT '',
-  blog_name C(255) DEFAULT '',
-  date T(14) NOTNULL,
-  properties TEXT NOTNULL DEFAULT ''
-";
-
-
-$Tables["users"] = "
-  id I(10)  NOTNULL AUTO PRIMARY,
-  user C(15) NOTNULL DEFAULT '' UNIQUE,
-  password C(32) NOTNULL DEFAULT '',
-  email C(255) NOTNULL DEFAULT '',
-  full_name C(255) NOTNULL DEFAULT '',
-  about X,
-  properties TEXT NOTNULL DEFAULT '',
-  status integer(4) NOTNULL DEFAULT 1,
-  resource_picture_id I(10) NOTNULL DEFAULT 0
-";
-
-$Tables["users_permissions"] = "
-  id I(10)  NOTNULL AUTO PRIMARY,
-  user_id I(10)  NOTNULL DEFAULT '0',
-  blog_id I(10)  NOTNULL DEFAULT '0',
-  permission_id I(10)  NOTNULL DEFAULT '0'
-";
-
-
-$Tables["config"] = "
-   id I(10) NOTNULL AUTO PRIMARY,
-   config_key C(255) NOTNULL DEFAULT '',
-   config_value X NOTNULL,
-   value_type I(3) DEFAULT '0'
-";
-
-$Tables["filtered_content"] = "
-   id I(10) NOTNULL AUTO PRIMARY,
-   reg_exp X,
-   blog_id I(10) NOTNULL DEFAULT '0',
-   reason X,
-   date T(14) DEFTIMESTAMP
-";
-
-$Tables["host_blocking_rules"] = "
-   id I(10) NOTNULL AUTO PRIMARY,
-   reason X,
-   date T(14) NOTNULL,
-   blog_id I(10) NOTNULL DEFAULT '0',
-   block_type I(1) DEFAULT '1',
-   list_type I(1) DEFAULT '1',
-   mask I(2) DEFAULT '0',
-   host C(15) DEFAULT '0.0.0.0'
-";
-
-$Tables["gallery_resources"] = "
-   id I(10) NOTNULL AUTO PRIMARY,
-   owner_id I(10) NOTNULL DEFAULT '0',
-   album_id I(10) NOTNULL DEFAULT '0',
-   description X,
-   date T(14) NOTNULL,
-   flags I(10) DEFAULT '0',
-   resource_type I(3) DEFAULT NULL,
-   file_path C(255) DEFAULT '',
-   file_name C(255) DEFAULT '',
-   metadata X,
-   thumbnail_format C(4) NOTNULL DEFAULT 'same',
-   normalized_description X NOTNULL DEFAULT '',
-   properties TEXT NOTNULL DEFAULT ''
-";
-
-$Tables["gallery_albums"] = "
-   id I(10) NOTNULL AUTO PRIMARY,
-   owner_id I(10) NOTNULL DEFAULT '0',
-   description X NOTNULL,
-   name C(255) NOTNULL DEFAULT '',
-   flags I(10) NOTNULL DEFAULT '0',
-   parent_id I(10) NOTNULL DEFAULT '0',
-   date T(14) NOTNULL,
-   properties X NOTNULL DEFAULT '',
-   show_album TINYI(1) DEFAULT 1,
-   normalized_description X NOTNULL DEFAULT '',
-   normalized_name C(255) NOTNULL DEFAULT '',
-   mangled_name C(255) NOTNULL DEFAULT ''
-";
-
-$Tables["bayesian_filter_info"] = "
-   id I(10)  NOTNULL AUTO PRIMARY,
-   blog_id I(10)  DEFAULT NULL,
-   total_spam I(10)  DEFAULT NULL,
-   total_nonspam I(10)  DEFAULT NULL
-";
-
-$Tables["bayesian_tokens"] = "
-   id I(10)  NOTNULL AUTO PRIMARY,
-   blog_id I(10)  DEFAULT NULL,
-   token char(100) DEFAULT NULL,
-   spam_occurrences I(10)  DEFAULT NULL,
-   nonspam_occurrences I(10)  DEFAULT NULL,
-   prob float DEFAULT NULL
-";
-
-$Tables["article_categories_link"] = "
-   article_id I(10) NOTNULL,
-   category_id I(10) NOTNULL
-";
-
-$Tables["custom_fields_definition"] = "
-   id I(10) NOTNULL AUTO PRIMARY,
-   field_name C(255) NOTNULL DEFAULT '',
-   field_description X NOTNULL,
-   field_type I(2) NOTNULL DEFAULT '1',
-   blog_id I(10) NOTNULL DEFAULT '0',
-   date TIMESTAMP(14),
-   searchable L DEFAULT 1,
-   hidden L DEFAULT 1
-";
-
-$Tables["custom_fields_values"] = "
-   id I(10) NOTNULL AUTO PRIMARY,
-   field_id I(10) NOTNULL DEFAULT '0',
-   field_value X NOTNULL,
-   normalized_value X NOTNULL,
-   blog_id I(10) DEFAULT NULL,
-   article_id I(10) DEFAULT NULL
-";
-
-/**
- * indexes
- */
-//$TableIndexes[][] = ;
-
 ?>
\ No newline at end of file

Added: plog/trunk/install/defaultconfig.properties.php
===================================================================
--- plog/trunk/install/defaultconfig.properties.php	2006-03-24 21:24:50 UTC (rev 3121)
+++ plog/trunk/install/defaultconfig.properties.php	2006-03-25 15:46:56 UTC (rev 3122)
@@ -0,0 +1,124 @@
+<?php
+
+$Inserts[0] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('comments_enabled','1',1);";
+$Inserts[1] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('rdf_enabled','1',1);";
+$Inserts[2] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('temp_folder','./tmp',3);";
+$Inserts[3] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('base_url','{plog_base_url}',3);";
+$Inserts[4] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('show_posts_max','15',1);";
+$Inserts[5] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('recent_posts_max','10',1);";
+$Inserts[6] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_template','standard',3);";
+$Inserts[7] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('template_folder','./templates',3);";
+$Inserts[8] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_blog_id','1',1);";
+$Inserts[9] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_locale','en_UK',3);";
+$Inserts[10] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('html_allowed_tags_in_comments','<a><i><br><br/><b>',3);";
+$Inserts[11] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('referer_tracker_enabled','1',1);";
+$Inserts[12] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('rss_parser_enabled','1',1);";
+$Inserts[13] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('show_more_enabled','1',1);";
+$Inserts[14] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('show_more_threshold','150',1);";
+$Inserts[15] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('update_article_reads','1',1);";
+$Inserts[16] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('email_service_enabled','1',1);";
+$Inserts[17] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('post_notification_source_address','noreply at your.host.com',3);";
+$Inserts[18] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('request_format_mode','1',1);";
+$Inserts[19] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('xmlrpc_ping_hosts','a:2:{i:0;s:27:\"http://rpc.weblogs.com/RPC2\";i:1;s:0:\"\";}',5);";
+$Inserts[20] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('trackback_server_enabled','1',1);";
+$Inserts[21] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('htmlarea_enabled','1',1);";
+$Inserts[22] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('plugin_manager_enabled','1',1);";
+$Inserts[23] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('check_email_address_validity','0',1);";
+$Inserts[24] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('summary_page_show_max','15',1);";
+$Inserts[25] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('minimum_password_length','4',1);";
+$Inserts[26] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('templates','a:3:{i:0;s:7:\"blueish\";i:1;s:4:\"grey\";i:2;s:8:\"standard\";}',5);";
+$Inserts[27] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('locales','a:0:{}',5)";
+$Inserts[28] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('email_service_type','php',3);";
+$Inserts[29] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_host','your.smtp.host.com',3);";
+$Inserts[30] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_port','25',1);";
+$Inserts[31] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_use_authentication','0',1);";
+$Inserts[32] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_username','',3);";
+$Inserts[33] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_password','',3);";
+$Inserts[34] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('locale_folder','./locale',3);";
+$Inserts[35] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('xmlrpc_ping_enabled','0',1);";
+$Inserts[36] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_tar','{path_to_tar}',3);";
+$Inserts[37] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_gzip','{path_to_gzip}',3);";
+$Inserts[38] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_bz2','{path_to_bz2}',3);";
+$Inserts[39] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_unzip','{path_to_unzip}',3);";
+$Inserts[40] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('users_can_add_templates',1,1);";
+$Inserts[41] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('maximum_file_upload_size', 2000000, 1);";
+$Inserts[42] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('upload_forbidden_files', '*.php *.php3 *.php4 *.phtml *.htm *.html *.exe *.com *.bat .htaccess *.sh', 3);";
+$Inserts[43] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('comments_order', 1, 1);";
+$Inserts[44] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('security_pipeline_enabled', 1, 1);";
+$Inserts[45] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('maximum_comment_size', 0, 1 );";
+$Inserts[46] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('resources_enabled', 1, 1 );";
+$Inserts[47] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnail_method', 'gd', 3);";
+$Inserts[48] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_convert', '{path_to_convert}', 3);";
+$Inserts[49] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnail_height', 120, 1);";
+$Inserts[50] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnail_width', 120, 1);";
+$Inserts[51] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnails_keep_aspect_ratio', 1, 1);";
+$Inserts[52] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('xmlrpc_api_enabled', 1, 1);";
+$Inserts[53] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('uploads_enabled', 1, 1);";
+$Inserts[54] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_rss_profile', 'rss090', 3);";
+$Inserts[55] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_enabled', 1, 2);";
+$Inserts[56] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_spam_probability_treshold', '0.9', 6);";
+$Inserts[57] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_nonspam_probability_treshold', '0.2', 6);";
+$Inserts[58] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_min_length_token', '3', 1);";
+$Inserts[59] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_max_length_token', '100', 1);";
+$Inserts[60] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_number_significant_tokens', 15, 1);";
+$Inserts[61] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_spam_comments_action', 0, 1 );";
+$Inserts[62] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('ip_address_filter_enabled', 1, 1 );";
+$Inserts[63] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('content_filter_enabled', 1, 1 );";
+$Inserts[64] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('thumbnail_format','same',3);";
+$Inserts[65] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resources_folder','./gallery/',3);";
+$Inserts[66] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('beautify_comments_text', '1', 1);";
+$Inserts[67] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('disable_apache_error_handler', '0', 1);";
+$Inserts[68] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('show_future_posts_in_calendar', '0', 1);";
+$Inserts[69] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('xhtml_converter_enabled', '1', 1);";
+$Inserts[70] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('xhtml_converter_aggresive_mode_enabled', '0', 1);";
+$Inserts[71] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('search_engine_enabled', '1', 1);";
+$Inserts[72] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('search_in_custom_fields', '1', 1);";
+$Inserts[73] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('search_in_comments', '1', 1);";
+$Inserts[74] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resources_quota', '0', 1);";
+$Inserts[75] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('category_link_format', '/blog/{blogname}/{catname}$', 3);";
+$Inserts[76] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('blog_link_format', '/blog/{blogname}$', 3);";
+$Inserts[77] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('archive_link_format', '/blog/{blogname}/archives/{year}/?{month}/?{day}', 3);";
+$Inserts[78] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('user_posts_link_format', '/blog/{blogname}/user/{username}$', 3);";
+$Inserts[79] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('post_trackbacks_link_format', '/blog/{blogname}/post/trackbacks/{postname}$', 3);";
+$Inserts[80] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('template_link_format', '/blog/{blogname}/content/{templatename}$', 3);";
+$Inserts[81] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('album_link_format', '/blog/{blogname}/album/{albumname}$', 3);";
+$Inserts[82] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resource_link_format', '/blog/{blogname}/resource/{albumname}/{resourcename}$', 3);";
+$Inserts[83] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resource_preview_link_format', '/blog/{blogname}/resource/{albumname}/preview/{resourcename}$', 3);";
+$Inserts[84] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resource_download_link_format', '/blog/{blogname}/resource/{albumname}/download/{resourcename}$', 3);";
+$Inserts[85] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('permalink_format', '/blog/{blogname}/{catname}/{year}/{month}/{day}/{postname}$', 3);";
+$Inserts[86] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('script_name', 'index.php', 3);";
+$Inserts[87] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('thumbnail_generator_use_smoothing_algorithm', '0', 1);";
+$Inserts[88] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resource_server_use_http_caching', '1', 1);";
+$Inserts[89] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('medium_size_thumbnail_width', '640', 1);";
+$Inserts[90] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('medium_size_thumbnail_height', '480', 1);";
+$Inserts[91] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resource_medium_size_preview_link_format', '/blog/{blogname}/resource/{albumname}/preview-med/{resourcename}$', 3);";
+$Inserts[92] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('subdomains_enabled', '0', 1);";
+$Inserts[93] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('include_blog_id_in_url', '1', 1);";
+$Inserts[94] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('send_xmlrpc_pings_enabled_by_default', '1', 1);";
+$Inserts[95] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('forbidden_usernames', 'admin www blog ftp wiki forums', 3);";
+$Inserts[96] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('force_registration_confirmation', '0', 1);";
+$Inserts[97] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('summary_blogs_per_page', '25', 3);";
+$Inserts[98] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('subdomains_base_url', '', 3);";
+$Inserts[99] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('autosave_new_drafts_time_millis', '300000', 3);";
+$Inserts[100] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('save_drafts_via_xmlhttprequest_enabled', '1', 1);";
+$Inserts[101] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('need_email_confirm_registration', '1', 1);";
+$Inserts[102] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('force_one_blog_per_email_account', '0', 1);";
+$Inserts[103] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('summary_show_agreement', '1', 1);";
+$Inserts[104] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('default_time_offset', '0', 3);";
+$Inserts[105] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('template_cache_enabled', '1', 1);";
+$Inserts[106] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('template_http_cache_enabled', '0', 1);";
+$Inserts[107] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('template_compile_check', '1', 1);";
+$Inserts[108] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('update_cached_article_reads', '1', 1);";
+$Inserts[109] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('allow_php_code_in_templates', '0', 1);";
+$Inserts[110] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('thumbnail_generator_use_smoothing_algorithm', '1', 1);";
+$Inserts[111] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('template_cache_lifetime', '-1', 3);";
+$Inserts[112] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('use_http_accept_language_detection', '0', 1);";
+$Inserts[113] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('session_save_path', '', 3);";
+$Inserts[114] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('skip_dashboard', '0', 1);";
+$Inserts[115] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('use_captcha_auth', '0', 1);";
+$Inserts[116] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('page_suffix_format', '/page/{page}', 3);";
+$Inserts[117] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('urlize_word_separator', '_', 3);";
+$Inserts[118] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('summary_template_cache_lifetime', '0', 1 );";
+$Inserts[119] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('http_cache_lifetime', '1800', 1 );";
+
+?>
\ No newline at end of file

Added: plog/trunk/templates/wizard/checks.template
===================================================================
--- plog/trunk/templates/wizard/checks.template	2006-03-24 21:24:50 UTC (rev 3121)
+++ plog/trunk/templates/wizard/checks.template	2006-03-25 15:46:56 UTC (rev 3122)
@@ -0,0 +1,45 @@
+{include file="wizard/header.template" title="1 Preinstallation Checks" step=1 mode=install}
+ <form name="databaseInfo" action="wizard.php" method="post">
+  <fieldset class="inputField">
+   <legend>Output</legend>  
+   {if $viewIsError}
+    <div class="wizardError">
+     <img src="imgs/admin/icon_error-16.png" alt="Error" class="wizardInfoIcon" />
+     <p style="color:red;margin-left:20px;">{$viewErrorMessage}</p>
+    </div> 
+   {else}
+     <div class="wizardInfo">
+      <img src="imgs/admin/icon_info-16.png" alt="Info" class="wizardInfoIcon" />
+      <p class="wizardInfoText">Welcome to the configuration wizard of LifeType. This wizard will guide you through the process of installing LifeType {$version}
+      <br/><br/>
+
+   {/if}
+   
+   {foreach from=$checks item=check key=checkId}
+    {** loop through the checks and show an error message if not passed, unless not critical **}
+    {$check->getDesc()}:<br/>
+    {if $check->isValid()}
+        <span style="color:green;font-weight:bold">PASSED</span>
+    {else}
+        {if $check->isCritical()}
+            <span style="color:red;font-weight:bold">ERROR</span>
+        {else}
+            <span style="color:yellow">NOT CRITICAL</span>
+        {/if}
+        <br/>{$check->getSolution()}
+    {/if}
+    <br/><br/>
+   {/foreach}
+   
+   </fieldset>
+   <div class="buttons">
+    {if $ok}
+      <input type="hidden" name="nextStep" value="Intro"/>
+      <input type="submit" name="Next" value="Next &raquo;"/>
+    {else}
+      <input type="hidden" name="nextStep" value="Checks"/>
+      <input type="submit" name="Next" value="Retry"/>    
+    {/if}
+   </div> 
+ </form>
+{include file="wizard/footer.template"}
\ No newline at end of file

Modified: plog/trunk/wizard.php
===================================================================
--- plog/trunk/wizard.php	2006-03-24 21:24:50 UTC (rev 3121)
+++ plog/trunk/wizard.php	2006-03-25 15:46:56 UTC (rev 3122)
@@ -22,6 +22,11 @@
     // transformations in more than one step
     //
     define( "WIZARD_MAX_RECORDS_THRESHOLD", 100 );
+    
+    //
+    // minimum php version required
+    //
+    define( "MIN_PHP_VERSION", "4.2.0" );
 
     // many hosts don't have this enabled and we, for the time being, need it...
     ini_set("arg_seperator.output", "&amp;");
@@ -52,14 +57,22 @@
     include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
     include_once( PLOG_CLASS_PATH."class/dao/articlecategories.class.php" );
     include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
-    include_once( PLOG_CLASS_PATH."class/dao/userpermissions.class.php" );    
+    include_once( PLOG_CLASS_PATH."class/dao/userpermissions.class.php" );
+    
+    // table schemas
+    include_once( PLOG_CLASS_PATH."install/dbschemas.properties.php" );
+    // changes necessary to the db schema when upgrading from 1.0 to 1.1
+    include_once( PLOG_CLASS_PATH."install/changes_10_11.properties.php" );
+    // default configuration values for 1.1
+    include_once( PLOG_CLASS_PATH."install/defaultconfig.properties.php" );
 
     define( "TEMP_FOLDER", "./tmp" );
 
     // sql querys used to create the tables
 
     // maps used to map requests with actions
-    $_actionMap["Default"] = "WizardIntro";
+    $_actionMap["Checks"] = "WizardChecks";
+    $_actionMap["Default"] = "WizardChecks";
     $_actionMap["Intro"] = "WizardIntro";
     $_actionMap["Step1"] = "WizardStepOne";
     $_actionMap["Step2"] = "WizardStepTwo";
@@ -70,574 +83,6 @@
     $_actionMap["Update2"] = "UpdateStepTwo";
     $_actionMap["Update3"] = "UpdateStepThree";
 
-
-
-    $Tables[0]["desc"] = "Articles";
-    $Tables[0]["code"] = "CREATE TABLE {dbprefix}articles (
-  id int(10) unsigned NOT NULL auto_increment,
-  category_id int(10) unsigned NOT NULL default '0',
-  date timestamp(14) NOT NULL,
-  modification_date timestamp(14) NOT NULL,
-  user_id int(10) unsigned NOT NULL default '0',
-  blog_id int(10) unsigned NOT NULL default '0',
-  status INTEGER(5) NOT NULL default 1,
-  num_reads int(10) default '0',
-  properties TEXT NOT NULL default '',
-  slug varchar(255) NOT NULL,
-  num_comments int(10) NOT NULL default '0', 
-  num_nonspam_comments int(10) NOT NULL default '0', 
-  num_trackbacks int(10) NOT NULL default '0',
-  num_nonspam_trackbacks int(10) NOT NULL default '0',
-  global_category_id int(10) NOT NULL default '0',
-  in_summary_page TINYINT(1) NOT NULL DEFAULT '1',  
-  PRIMARY KEY (id),
-  KEY num_reads (num_reads),
-  KEY category_id (category_id),
-  KEY blog_id (blog_id),
-  KEY user_id (user_id),
-  KEY slug (slug),
-  KEY blog_id_slug (blog_id,slug),
-  KEY blog_id_slug_category_id (blog_id,slug,category_id)
-) TYPE=MyISAM;";
-
-    $Tables[1]["desc"] = "Article categories";
-    $Tables[1]["code"] = "CREATE TABLE {dbprefix}articles_categories (
-  id int(10) unsigned NOT NULL auto_increment,
-  name varchar(255) NOT NULL default '',
-  url varchar(255) NOT NULL default '',
-  blog_id int(10) unsigned NOT NULL default '0',
-  last_modification timestamp(14) NOT NULL,
-  in_main_page TINYINT(1) NOT NULL DEFAULT '1',
-  parent_id INTEGER(10) NOT NULL DEFAULT '0',
-  description TEXT NOT NULL DEFAULT '',
-  properties text NOT NULL default '',
-  mangled_name varchar(255) NOT NULL default '',
-  num_articles int(10) NOT NULL default 0,
-  num_published_articles int(10) NOT NULL default 0,
-  PRIMARY KEY  (id),
-  KEY parent_id (parent_id),
-  KEY blog_id (blog_id),
-  KEY mangled_name (mangled_name)
-) TYPE=MyISAM;";
-
-    $Tables[2]["desc"] = "Comments";
-    $Tables[2]["code"] = "CREATE TABLE {dbprefix}articles_comments (
-  id int(10) unsigned NOT NULL auto_increment,
-  article_id int(10) unsigned NOT NULL default '0',
-  blog_id int(10) unsigned NOT NULL default '0',
-  topic text NOT NULL,
-  text text,
-  date timestamp(14) NOT NULL,
-  user_email varchar(255) default '',
-  user_url varchar(255) default '',
-  user_name varchar(255) NOT NULL default 'Anonymous',
-  parent_id int(10) unsigned default '0',
-  client_ip varchar(15) default '0.0.0.0',
-  send_notification tinyint(1) default '0',
-  status tinyint(2) default '1',
-  spam_rate float default '0',
-  properties TEXT NOT NULL DEFAULT '',
-  normalized_text TEXT NOT NULL DEFAULT '',
-  normalized_topic TEXT NOT NULL DEFAULT '',
-  type int(3) NOT NULL DEFAULT '0',  
-  PRIMARY KEY  (id),
-  KEY parent_id (parent_id),
-  KEY article_id (article_id),
-  KEY blog_id (blog_id),
-  KEY article_id_blog_id(article_id,blog_id),
-  FULLTEXT KEY normalized_fields (normalized_text,normalized_topic),
-  FULLTEXT KEY normalized_text (normalized_text),
-  FULLTEXT KEY normalized_topic (normalized_topic)
-) TYPE=MyISAM;";
-
-    $Tables[3]["desc"] = "Notifications";
-    $Tables[3]["code"] = "CREATE TABLE {dbprefix}articles_notifications (
-  id int(10) NOT NULL auto_increment,
-  blog_id int(10) NOT NULL default '0',
-  user_id int(10) NOT NULL default '0',
-  article_id int(10) NOT NULL default '0',
-  PRIMARY KEY  (id),
-  KEY article_id (article_id),
-  KEY user_id (user_id),
-  KEY blog_id (blog_id)
-) TYPE=MyISAM;";
-
-    $Tables[4]["desc"] = "Blogs";
-    $Tables[4]["code"] = "CREATE TABLE {dbprefix}blogs (
-  id int(10) unsigned NOT NULL auto_increment,
-  blog varchar(50) NOT NULL default '',
-  owner_id int(10) unsigned NOT NULL default '0',
-  blog_category_id int(10) unsigned NOT NULL default '0',
-  about text,
-  settings text NOT NULL,
-  mangled_blog varchar(50) NOT NULL default '',
-  status int(4) NOT NULL default '1',
-  show_in_summary int(4) not null default '1',
-  create_date TIMESTAMP(14) NOT NULL,
-  last_update_date TIMESTAMP(14) NOT NULL,
-  num_posts int(10) NOT NULL DEFAULT '0',
-  num_comments int(10) NOT NULL DEFAULT '0',
-  num_trackbacks int(10) NOT NULL DEFAULT '0',
-  PRIMARY KEY  (id),
-  KEY owner_id (owner_id),
-  KEY mangled_blog (mangled_blog),
-  KEY blog_category_id(blog_category_id)
-) TYPE=MyISAM;";
-
-    $Tables[5]["desc"] = "MyLinks";
-    $Tables[5]["code"] = "CREATE TABLE {dbprefix}mylinks (
-  id int(10) unsigned NOT NULL auto_increment,
-  category_id int(10) unsigned NOT NULL default '0',
-  url varchar(255) NOT NULL default '',
-  name varchar(100) default '',
-  description text NOT NULL,
-  blog_id int(10) unsigned NOT NULL default '0',
-  rss_feed varchar(255) not null default '',
-  date timestamp(14) not null,
-  properties TEXT NOT NULL DEFAULT '',
-  PRIMARY KEY  (id),
-  KEY blog_id (blog_id),
-  KEY category_id (category_id)
-) TYPE=MyISAM;";
-
-    $Tables[6]["desc"] = "MyLinks Categories";
-    $Tables[6]["code"] = "CREATE TABLE {dbprefix}mylinks_categories (
-  id int(10) NOT NULL auto_increment,
-  name varchar(100) NOT NULL default '',
-  blog_id int(10) NOT NULL default '0',
-  last_modification timestamp(14) NOT NULL,
-  properties TEXT NOT NULL DEFAULT '',
-  num_links int(10) NOT NULL default '0',
-  PRIMARY KEY  (id),
-  KEY blog_id (blog_id)
-) TYPE=MyISAM;";
-
-    $Tables[9]["desc"] = "Permissions";
-    $Tables[9]["code"] = "CREATE TABLE {dbprefix}permissions (
-  id int(10) unsigned NOT NULL auto_increment,
-  permission varchar(25) NOT NULL default '',
-  description varchar(100) NOT NULL default '',
-  PRIMARY KEY  (id)
-) TYPE=MyISAM;";
-
-    $Tables[10]["desc"] = "Referrers";
-    $Tables[10]["code"] = "CREATE TABLE {dbprefix}referers (
-  id int(10) NOT NULL auto_increment,
-  url text NOT NULL,
-  article_id int(10) NOT NULL default '0',
-  blog_id int(10) NOT NULL default '0',
-  hits int(10) default '1',
-  last_date timestamp(14),
-  PRIMARY KEY  (id),
-  KEY article_id (article_id),
-  KEY blog_id (blog_id),
-  KEY blog_id_article_id (blog_id, article_id)
-) TYPE=MyISAM;";
-
-    $Tables[12]["desc"] = "Users";
-    $Tables[12]["code"] = "CREATE TABLE {dbprefix}users (
-  id int(10) unsigned NOT NULL auto_increment,
-  user varchar(15) NOT NULL default '',
-  password varchar(32) NOT NULL default '',
-  email varchar(255) NOT NULL default '',
-  full_name varchar(255) NOT NULL default '',
-  about text,
-  properties TEXT NOT NULL default '',
-  status integer(4) NOT NULL DEFAULT 1,
-  resource_picture_id integer(10) NOT NULL DEFAULT 0,
-  site_admin int(10) NOT NULL default '0',
-  PRIMARY KEY  (id),
-  UNIQUE KEY user (user)
-) TYPE=MyISAM;";
-
-    $Tables[13]["desc"] = "Permissions";
-    $Tables[13]["code"] = "CREATE TABLE {dbprefix}users_permissions (
-  id int(10) unsigned NOT NULL auto_increment,
-  user_id int(10) unsigned NOT NULL default '0',
-  blog_id int(10) unsigned NOT NULL default '0',
-  permission_id int(10) unsigned NOT NULL default '0',
-  PRIMARY KEY  (id),
-  KEY user_id (user_id),
-  KEY blog_id (blog_id),
-  KEY user_id_permission_id (user_id,permission_id)
-) TYPE=MyISAM;";
-
-
-   $Tables[14]["desc"] = "Configuration";
-   $Tables[14]["code"] = "CREATE TABLE {dbprefix}config (
-   id int(10) NOT NULL auto_increment,
-   config_key varchar(255) NOT NULL default '',
-   config_value text NOT NULL,
-   value_type int(3) default '0',
-   PRIMARY KEY  (id,config_key)
-   ) TYPE=MyISAM;";
-
-   $Tables[15]["desc"] = "Filtered Content";
-   $Tables[15]["code"] = "CREATE TABLE {dbprefix}filtered_content (
-   id int(10) NOT NULL auto_increment,
-   reg_exp text,
-   blog_id int(10) NOT NULL default '0',
-   reason text,
-   date timestamp(14) NOT NULL,
-   PRIMARY KEY  (id),
-   KEY blog_id (blog_id)
-   ) TYPE=MyISAM;";
-
-   $Tables[16]["desc"] = "Blocked content";
-   $Tables[16]["code"] = "CREATE TABLE {dbprefix}host_blocking_rules (
-   id int(10) NOT NULL auto_increment,
-   reason text,
-   date timestamp(14) NOT NULL,
-   blog_id int(10) NOT NULL default '0',
-   block_type int(1) default '1',
-   list_type int(1) default '1',
-   mask int(2) default '0',
-   host varchar(15) default '0.0.0.0',
-   PRIMARY KEY  (id),
-   KEY blog_id (blog_id)
-   ) TYPE=MyISAM;";
-
-   $Tables[17]["desc"] = "Gallery Resources";
-   $Tables[17]["code"] = "CREATE TABLE {dbprefix}gallery_resources (
-   id int(10) NOT NULL auto_increment,
-   owner_id int(10) NOT NULL default '0',
-   album_id int(10) NOT NULL default '0',
-   description text,
-   date timestamp(14) NOT NULL,
-   flags int(10) default '0',
-   resource_type int(3) default NULL,
-   file_path varchar(255) default '',
-   file_name varchar(255) default '',
-   file_size int(20) not null default 0,
-   metadata text,
-   thumbnail_format varchar(4) not null default 'same',
-   normalized_description text NOT NULL default '',
-   properties TEXT NOT NULL DEFAULT '',
-   PRIMARY KEY  (id),
-   KEY album_id (album_id),
-   KEY owner_id (owner_id),
-   KEY file_name (file_name),
-   KEY album_id_owner_id (album_id, owner_id),
-   KEY resource_type (resource_type),
-   FULLTEXT KEY normalized_description (normalized_description)
-   ) TYPE=MyISAM;";
-
-   $Tables[18]["desc"] = "Gallery Albums";
-   $Tables[18]["code"] = "CREATE TABLE {dbprefix}gallery_albums (
-   id int(10) NOT NULL auto_increment,
-   owner_id int(10) NOT NULL default '0',
-   description text NOT NULL,
-   name varchar(255) NOT NULL default '',
-   flags int(10) NOT NULL default '0',
-   parent_id int(10) NOT NULL default '0',
-   date timestamp(14) NOT NULL,
-   properties text NOT NULL DEFAULT '',
-   show_album TINYINT(1) DEFAULT 1,
-   normalized_description text NOT NULL default '',
-   normalized_name varchar(255) NOT NULL default '',
-   mangled_name varchar(255) NOT NULL default '',
-   num_resources int(10) NOT NULL default '0',
-   num_children int(10) NOT NULL default '0',
-   PRIMARY KEY  (id),
-   KEY parent_id (parent_id),
-   KEY owner_id (owner_id),
-   KEY mangled_name (mangled_name),
-   KEY owner_id_mangled_name (owner_id, mangled_name),
-   FULLTEXT KEY normalized_name (normalized_name),
-   FULLTEXT KEY normalized_description (normalized_description),
-   FULLTEXT KEY normalized_fields (normalized_name, normalized_description)
-   ) TYPE=MyISAM;";
-
-   $Tables[19]["desc"] = "Bayesian Filter data table";
-   $Tables[19]["code"] = "CREATE TABLE {dbprefix}bayesian_filter_info (
-   id int(10) unsigned NOT NULL auto_increment,
-   blog_id int(10) unsigned default NULL,
-   total_spam int(10) unsigned default NULL,
-   total_nonspam int(10) unsigned default NULL,
-   PRIMARY KEY  (id),
-   KEY blog_id (blog_id)
-   ) TYPE=MyISAM;";
-
-   $Tables[20]["desc"] = "Bayesian Filter Information";
-   $Tables[20]["code"] = "CREATE TABLE {dbprefix}bayesian_tokens (
-   id int(10) unsigned NOT NULL auto_increment,
-   blog_id int(10) unsigned default NULL,
-   token char(100) default NULL,
-   spam_occurrences int(10) unsigned default NULL,
-   nonspam_occurrences int(10) unsigned default NULL,
-   prob float default NULL,
-   PRIMARY KEY  (id),
-   KEY blog_id (blog_id),
-   KEY token (token)
-   ) TYPE=MyISAM;";
-
-   $Tables[21]["desc"] = "Map of categories to articles";
-   $Tables[21]["code"] = "CREATE TABLE {dbprefix}article_categories_link(
-   article_id int(10) NOT NULL,
-   category_id int(10) NOT NULL,
-   PRIMARY KEY (article_id, category_id)
-   ) TYPE=MyISAM;";
-
-   $Tables[22]["desc"] = "Definition of custom fields";
-   $Tables[22]["code"] = "CREATE TABLE {dbprefix}custom_fields_definition (
-   id int(10) NOT NULL auto_increment,
-   field_name varchar(255) NOT NULL default '',
-   field_description text NOT NULL,
-   field_type int(2) NOT NULL default '1',
-   blog_id int(10) NOT NULL default '0',
-   date TIMESTAMP(14),
-   searchable TINYINT(1) default 1,
-   hidden TINYINT(1) default 1,
-   PRIMARY KEY  (id,field_name),
-   KEY blog_id (blog_id)
-   ) TYPE=MyISAM;";
-
-   $Tables[23]["desc"] = "Custom fields that have been assigned to articles";
-   $Tables[23]["code"] = "CREATE TABLE {dbprefix}custom_fields_values (
-   id int(10) NOT NULL auto_increment,
-   field_id int(10) NOT NULL default '0',
-   field_value text NOT NULL,
-   normalized_value text NOT NULL,
-   blog_id int(10) default NULL,
-   article_id int(10) default NULL,
-   PRIMARY KEY  (id),
-   FULLTEXT KEY normalized_value (normalized_value),
-   KEY blog_id (blog_id),
-   KEY article_id (article_id),
-   KEY field_id (field_id),
-   KEY blog_id_article_id (blog_id, article_id)
-   ) TYPE=MyISAM;";
-
-   $Tables[24]["desc"] = "Text of the articles";
-   $Tables[24]["code"] = "CREATE TABLE {dbprefix}articles_text (
-   id int(10) NOT NULL auto_increment,
-   article_id int(10) NOT NULL DEFAULT 0,
-   text TEXT NOT NULL DEFAULT '',
-   topic TEXT NOT NULL DEFAULT '',
-   normalized_text TEXT NOT NULL DEFAULT '',
-   normalized_topic TEXT NOT NULL DEFAULT '',
-   mangled_topic text NOT NULL,
-   PRIMARY KEY (id),
-   KEY article_id (article_id),
-   FULLTEXT KEY normalized_text (normalized_text),
-   FULLTEXT KEY normalized_topic (normalized_topic),
-   FULLTEXT KEY normalized_fields (normalized_text, normalized_topic)
-   ) TYPE=MyISAM;";
-   
-   $Tables[25]["desc"] = "PhpBB2 User Integration Table";
-   $Tables[25]["code"] = "CREATE TABLE {dbprefix}phpbb2_users (
-   id int(10) unsigned NOT NULL auto_increment,
-   phpbb_id int(10) unsigned NOT NULL,
-   full_name varchar(255) NOT NULL default '',
-   about text,
-   properties TEXT NOT NULL default '',
-   resource_picture_id integer(10) NOT NULL DEFAULT 0,
-   status INTEGER(10) NOT NULL DEFAULT 0,
-   PRIMARY KEY  (id),
-   UNIQUE KEY phpbb_id(phpbb_id)
-   ) TYPE=MyISAM;";
-   
-   /*** new in 1.1 ***/   
-   $Tables[26]["desc"] = "Blog categories";
-   $Tables[26]["code"] = "CREATE TABLE {dbprefix}blog_categories (
-   id int(10) unsigned NOT NULL auto_increment,
-   name varchar(255) NOT NULL default '',
-   description varchar(255) NOT NULL default '',
-   mangled_name varchar(255) NOT NULL default '',
-   properties TEXT NOT NULL DEFAULT '',
-   num_blogs int(10) NOT NULL default '0',
-   num_active_blogs int(10) NOT NULL default '0',
-   PRIMARY KEY (id),
-   KEY mangled_name(mangled_name)
-   ) TYPE=MyISAM;";
-   
-   $Tables[27]["desc"] = "Global Article categories";
-   $Tables[27]["code"] = "CREATE TABLE {dbprefix}global_articles_categories (
-   id int(10) unsigned NOT NULL auto_increment,
-   name varchar(255) NOT NULL default '',
-   description varchar(255) NOT NULL default '',
-   mangled_name varchar(255) NOT NULL default '',
-   properties TEXT NOT NULL DEFAULT '',
-   num_articles int(10) NOT NULL default '0',
-   num_active_articles int(10) NOT NULL default '0',
-   PRIMARY KEY (id),
-   KEY mangled_name(mangled_name)
-   ) TYPE=MyISAM;";
-   
-
-   // ---
-   // changes needed in 1.1
-   // ---
-// leftover changes from 0.3.2.  It doesn't matter if these fail.
-// ignore the failures
-$Changes["Deletions"] = Array(
-    "ALTER TABLE {dbprefix}articles DROP COLUMN category_id",
-    "ALTER TABLE {dbprefix}blogs DROP COLUMN show_in_summary",
-);
-
-$Changes["Articles"] = Array(    
-    "ALTER TABLE {dbprefix}articles ADD COLUMN num_comments INTEGER(10) NOT NULL DEFAULT 0",
-    "ALTER TABLE {dbprefix}articles ADD COLUMN num_nonspam_comments INTEGER(10) NOT NULL DEFAULT 0",
-    "ALTER TABLE {dbprefix}articles ADD COLUMN num_trackbacks INTEGER(10) NOT NULL DEFAULT 0",
-    "ALTER TABLE {dbprefix}articles ADD COLUMN num_nonspam_trackbacks INTEGER(10) NOT NULL DEFAULT 0",
-    "ALTER TABLE {dbprefix}articles ADD COLUMN global_category_id INTEGER(10) NOT NULL DEFAULT 0",
-    "ALTER TABLE {dbprefix}articles ADD COLUMN in_summary_page TINYINT(10) NOT NULL DEFAULT 1", 
-    "ALTER TABLE {dbprefix}articles ADD COLUMN modification_date TIMESTAMP(14) NOT NULL"
-);
-$Changes["Article Categories"] = Array(
-    "ALTER TABLE {dbprefix}articles_categories ADD COLUMN num_articles INTEGER(10) NOT NULL DEFAULT 0",
-    "ALTER TABLE {dbprefix}articles_categories ADD COLUMN num_published_articles INTEGER(10) NOT NULL DEFAULT 0"
-);
-$Changes["Article Comments"] = Array(
-    "ALTER TABLE {dbprefix}articles_comments ADD COLUMN type INTEGER(2) NOT NULL DEFAULT 1",
-    "ALTER TABLE {dbprefix}articles_comments ADD COLUMN blog_id INTEGER(10) NOT NULL DEFAULT 0",
-);
-$Changes["Blogs"] = Array(
-    "ALTER TABLE {dbprefix}blogs ADD COLUMN create_date TIMESTAMP(14)",
-    "ALTER TABLE {dbprefix}blogs ADD COLUMN last_update_date TIMESTAMP(14)",
-    "ALTER TABLE {dbprefix}blogs ADD COLUMN num_posts INT(10) NOT NULL DEFAULT 0",
-    "ALTER TABLE {dbprefix}blogs ADD COLUMN num_comments INT(10) NOT NULL DEFAULT 0",    
-    "ALTER TABLE {dbprefix}blogs ADD COLUMN num_trackbacks INT(10) NOT NULL DEFAULT 0",
-    "ALTER TABLE {dbprefix}blogs ADD COLUMN show_in_summary INT(4) NOT NULL DEFAULT 1",
-    "ALTER TABLE {dbprefix}blogs ADD COLUMN blog_category_id INT(4) NOT NULL DEFAULT 0"    
-);
-$Changes["Gallery Albums"] = Array(
-    "ALTER TABLE {dbprefix}gallery_albums ADD COLUMN num_resources INT(10)",
-    "ALTER TABLE {dbprefix}gallery_albums ADD COLUMN num_children INT(10)"
-);
-$Changes["Links Categories"] = Array(
-    "ALTER TABLE {dbprefix}mylinks_categories ADD COLUMN num_links INT(10)"
-);
-$Changes["Users"] = Array(
-    "ALTER TABLE {dbprefix}users ADD COLUMN site_admin INT(10)"
-);
-
-
-   // ---
-   // end of changes needed in 1.0
-   // ---
-
-$Inserts[0] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('comments_enabled','1',1);";
-$Inserts[1] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('rdf_enabled','1',1);";
-$Inserts[2] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('temp_folder','./tmp',3);";
-$Inserts[3] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('base_url','{plog_base_url}',3);";
-$Inserts[4] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('show_posts_max','15',1);";
-$Inserts[5] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('recent_posts_max','10',1);";
-$Inserts[6] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_template','standard',3);";
-$Inserts[7] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('template_folder','./templates',3);";
-$Inserts[8] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_blog_id','1',1);";
-$Inserts[9] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_locale','en_UK',3);";
-$Inserts[10] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('html_allowed_tags_in_comments','<a><i><br><br/><b>',3);";
-$Inserts[11] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('referer_tracker_enabled','1',1);";
-$Inserts[12] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('rss_parser_enabled','1',1);";
-$Inserts[13] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('show_more_enabled','1',1);";
-$Inserts[14] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('show_more_threshold','150',1);";
-$Inserts[15] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('update_article_reads','1',1);";
-$Inserts[16] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('email_service_enabled','1',1);";
-$Inserts[17] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('post_notification_source_address','noreply at your.host.com',3);";
-$Inserts[18] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('request_format_mode','1',1);";
-$Inserts[19] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('xmlrpc_ping_hosts','a:2:{i:0;s:27:\"http://rpc.weblogs.com/RPC2\";i:1;s:0:\"\";}',5);";
-$Inserts[20] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('trackback_server_enabled','1',1);";
-$Inserts[21] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('htmlarea_enabled','1',1);";
-$Inserts[22] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('plugin_manager_enabled','1',1);";
-$Inserts[23] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('check_email_address_validity','0',1);";
-$Inserts[24] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('summary_page_show_max','15',1);";
-$Inserts[25] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('minimum_password_length','4',1);";
-$Inserts[26] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('templates','a:3:{i:0;s:7:\"blueish\";i:1;s:4:\"grey\";i:2;s:8:\"standard\";}',5);";
-$Inserts[27] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('locales','a:0:{}',5)";
-$Inserts[28] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('email_service_type','php',3);";
-$Inserts[29] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_host','your.smtp.host.com',3);";
-$Inserts[30] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_port','25',1);";
-$Inserts[31] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_use_authentication','0',1);";
-$Inserts[32] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_username','',3);";
-$Inserts[33] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('smtp_password','',3);";
-$Inserts[34] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('locale_folder','./locale',3);";
-$Inserts[35] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('xmlrpc_ping_enabled','0',1);";
-$Inserts[36] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_tar','{path_to_tar}',3);";
-$Inserts[37] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_gzip','{path_to_gzip}',3);";
-$Inserts[38] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_bz2','{path_to_bz2}',3);";
-$Inserts[39] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_unzip','{path_to_unzip}',3);";
-$Inserts[40] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('users_can_add_templates',1,1);";
-$Inserts[41] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('maximum_file_upload_size', 2000000, 1);";
-$Inserts[42] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('upload_forbidden_files', '*.php *.php3 *.php4 *.phtml *.htm *.html *.exe *.com *.bat .htaccess *.sh', 3);";
-$Inserts[43] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('comments_order', 1, 1);";
-$Inserts[44] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('security_pipeline_enabled', 1, 1);";
-$Inserts[45] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('maximum_comment_size', 0, 1 );";
-$Inserts[46] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('resources_enabled', 1, 1 );";
-$Inserts[47] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnail_method', 'gd', 3);";
-$Inserts[48] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('path_to_convert', '{path_to_convert}', 3);";
-$Inserts[49] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnail_height', 120, 1);";
-$Inserts[50] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnail_width', 120, 1);";
-$Inserts[51] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('thumbnails_keep_aspect_ratio', 1, 1);";
-$Inserts[52] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('xmlrpc_api_enabled', 1, 1);";
-$Inserts[53] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('uploads_enabled', 1, 1);";
-$Inserts[54] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES ('default_rss_profile', 'rss090', 3);";
-$Inserts[55] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_enabled', 1, 2);";
-$Inserts[56] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_spam_probability_treshold', '0.9', 6);";
-$Inserts[57] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_nonspam_probability_treshold', '0.2', 6);";
-$Inserts[58] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_min_length_token', '3', 1);";
-$Inserts[59] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_max_length_token', '100', 1);";
-$Inserts[60] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_number_significant_tokens', 15, 1);";
-$Inserts[61] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('bayesian_filter_spam_comments_action', 0, 1 );";
-$Inserts[62] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('ip_address_filter_enabled', 1, 1 );";
-$Inserts[63] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('content_filter_enabled', 1, 1 );";
-$Inserts[64] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('thumbnail_format','same',3);";
-$Inserts[65] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resources_folder','./gallery/',3);";
-$Inserts[66] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('beautify_comments_text', '1', 1);";
-$Inserts[67] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('disable_apache_error_handler', '0', 1);";
-$Inserts[68] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('show_future_posts_in_calendar', '0', 1);";
-$Inserts[69] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('xhtml_converter_enabled', '1', 1);";
-$Inserts[70] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('xhtml_converter_aggresive_mode_enabled', '0', 1);";
-$Inserts[71] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('search_engine_enabled', '1', 1);";
-$Inserts[72] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('search_in_custom_fields', '1', 1);";
-$Inserts[73] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('search_in_comments', '1', 1);";
-$Inserts[74] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resources_quota', '0', 1);";
-$Inserts[75] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('category_link_format', '/blog/{blogname}/{catname}$', 3);";
-$Inserts[76] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('blog_link_format', '/blog/{blogname}$', 3);";
-$Inserts[77] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('archive_link_format', '/blog/{blogname}/archives/{year}/?{month}/?{day}', 3);";
-$Inserts[78] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('user_posts_link_format', '/blog/{blogname}/user/{username}$', 3);";
-$Inserts[79] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('post_trackbacks_link_format', '/blog/{blogname}/post/trackbacks/{postname}$', 3);";
-$Inserts[80] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('template_link_format', '/blog/{blogname}/content/{templatename}$', 3);";
-$Inserts[81] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('album_link_format', '/blog/{blogname}/album/{albumname}$', 3);";
-$Inserts[82] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resource_link_format', '/blog/{blogname}/resource/{albumname}/{resourcename}$', 3);";
-$Inserts[83] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resource_preview_link_format', '/blog/{blogname}/resource/{albumname}/preview/{resourcename}$', 3);";
-$Inserts[84] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resource_download_link_format', '/blog/{blogname}/resource/{albumname}/download/{resourcename}$', 3);";
-$Inserts[85] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('permalink_format', '/blog/{blogname}/{catname}/{year}/{month}/{day}/{postname}$', 3);";
-$Inserts[86] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('script_name', 'index.php', 3);";
-$Inserts[87] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('thumbnail_generator_use_smoothing_algorithm', '0', 1);";
-$Inserts[88] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resource_server_use_http_caching', '1', 1);";
-$Inserts[89] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('medium_size_thumbnail_width', '640', 1);";
-$Inserts[90] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('medium_size_thumbnail_height', '480', 1);";
-$Inserts[91] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('resource_medium_size_preview_link_format', '/blog/{blogname}/resource/{albumname}/preview-med/{resourcename}$', 3);";
-$Inserts[92] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('subdomains_enabled', '0', 1);";
-$Inserts[93] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('include_blog_id_in_url', '1', 1);";
-$Inserts[94] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('send_xmlrpc_pings_enabled_by_default', '1', 1);";
-$Inserts[95] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('forbidden_usernames', 'admin www blog ftp wiki forums', 3);";
-$Inserts[96] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('force_registration_confirmation', '0', 1);";
-$Inserts[97] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('summary_blogs_per_page', '25', 3);";
-$Inserts[98] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('subdomains_base_url', '', 3);";
-$Inserts[99] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('autosave_new_drafts_time_millis', '300000', 3);";
-$Inserts[100] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('save_drafts_via_xmlhttprequest_enabled', '1', 1);";
-$Inserts[101] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('need_email_confirm_registration', '1', 1);";
-$Inserts[102] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('force_one_blog_per_email_account', '0', 1);";
-$Inserts[103] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('summary_show_agreement', '1', 1);";
-$Inserts[104] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('default_time_offset', '0', 3);";
-$Inserts[105] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('template_cache_enabled', '1', 1);";
-$Inserts[106] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('template_http_cache_enabled', '0', 1);";
-$Inserts[107] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('template_compile_check', '1', 1);";
-$Inserts[108] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('update_cached_article_reads', '1', 1);";
-$Inserts[109] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('allow_php_code_in_templates', '0', 1);";
-$Inserts[110] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('thumbnail_generator_use_smoothing_algorithm', '1', 1);";
-$Inserts[111] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('template_cache_lifetime', '-1', 3);";
-$Inserts[112] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('use_http_accept_language_detection', '0', 1);";
-$Inserts[113] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('session_save_path', '', 3);";
-$Inserts[114] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('skip_dashboard', '0', 1);";
-$Inserts[115] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('use_captcha_auth', '0', 1);";
-$Inserts[116] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('page_suffix_format', '/page/{page}', 3);";
-$Inserts[117] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('urlize_word_separator', '_', 3);";
-$Inserts[118] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('summary_template_cache_lifetime', '0', 1 );";
-$Inserts[119] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('http_cache_lifetime', '1800', 1 );";
-
     /**
      * Open a connection to the database
      */
@@ -734,6 +179,195 @@
             print $t->fetch( $templateFileName );
         }
     }
+    
+    class WizardValidator
+    {
+        var $_desc;
+        var $_critical;
+        var $_valid;
+        var $_solution;
+    
+        function WizardValidator( $desc = "", $solution = "", $critical = true )
+        {            
+            $this->_desc = $desc;
+            $this->_critical = true;
+            $this->_valid = false;
+            $this->_solution = $solution;
+        }
+        
+        function isCritical()
+        {
+            return( $this->_critical );
+        }
+        
+        function getDesc()
+        {
+            return( $this->_desc );
+        }
+        
+        function isValid()
+        {
+            return( $this->_valid );
+        }
+        
+        function getSolution()
+        {
+            return( $this->_solution );
+        }
+        
+        function validate() 
+        {
+            return( $this->_valid );
+        }
+    }
+    
+    class WizardWritableFileValidator extends WizardValidator
+    {
+        var $_file;
+        
+        function WizardWritableFileValidator( $file )
+        {
+            $this->WizardValidator( "Checking if file/folder <b>$file</b> is writable", 
+                                    "Please make sure that the file is writable by the web server",
+                                    true );
+            $this->_file = $file;
+        }
+    
+        function validate()
+        {
+            $this->_valid = File::isWritable( $this->_file );
+            return( parent::validate());
+        }
+    }
+    
+    class WizardPhpVersionValidator extends WizardValidator
+    {
+        function WizardPhpVersionValidator( $minVersion = MIN_PHP_VERSION )
+        {
+            $this->WizardValidator( "Checking if the installed PHP version is at least <b>$minVersion</b>", 
+                                    "Please upgrade your version of PHP to $minVersion or newer",
+                                    true );
+            $this->_minVersion = $minVersion;
+        }
+    
+        function validate()
+        {
+            $this->_valid = version_compare( phpversion(), $this->_minVersion ) >= 0;
+            return( parent::validate());            
+        }
+    }
+    
+    class WizardSessionFunctionsAvailableValidator extends WizardValidator
+    {
+        function WizardSessionFunctionsAvailableValidator()
+        {
+            $this->WizardValidator( "Checking if session functions are available", 
+                                    "LifeType requires support for sessions to be part of your PHP installation",
+                                    true );
+        }
+    
+        function validate()
+        {
+            $this->_valid = function_exists( "session_start" ) &&
+                            function_exists( "session_destroy" ) &&
+                            function_exists( "session_cache_limiter" ) &&
+                            function_exists( "session_name" ) &&
+                            function_exists( "session_set_cookie_params" ) &&
+                            function_exists( "session_save_path" );
+            return( parent::validate());            
+        }
+    }
+    
+    class WizardMySQLFunctionsAvailableValidator extends WizardValidator
+    {
+        function WizardMySQLFunctionsAvailableValidator()
+        {
+            $this->WizardValidator( "Checking if MySQL functions are available", 
+                                    "LifeType requires support for MySQL to be part of your PHP installation",
+                                    true );
+        }
+    
+        function validate()
+        {
+            $this->_valid = function_exists( "mysql_select_db" ) &&
+                            function_exists( "mysql_query" ) &&
+                            function_exists( "mysql_connect" ) &&
+                            function_exists( "mysql_fetch_assoc" ) &&
+                            function_exists( "mysql_num_rows" ) &&
+                            function_exists( "mysql_free_result" );
+            return( parent::validate());                            
+        }        
+    }
+    
+    class WizardXmlFunctionsAvailableValidator extends WizardValidator
+    {
+        function WizardXmlFunctionsAvailableValidator()
+        {
+            $this->WizardValidator( "Checking if XML functions are available", 
+                                    "LifeType requires support for XML to be part of your PHP installation",
+                                    true );
+        }    
+    
+        function validate()
+        {
+            $this->_valid = function_exists( "xml_set_object" ) &&
+                            function_exists( "xml_set_element_handler" ) &&
+                            function_exists( "xml_parser_create" ) &&
+                            function_exists( "xml_parser_set_option" ) &&
+                            function_exists( "xml_parse" ) &&
+                            function_exists( "xml_parser_free" );
+            return( parent::validate());                            
+        }        
+    }
+    
+    class WizardSafeModeValidator extends WizardValidator
+    {
+        function WizardSafeModeValidator()
+        {
+            $this->WizardValidator( "Checking if safe mode is enabled", 
+                                    "LifeType can run when PHP's safe mode is enabled, but please see <a href=\"<span style=\"color:red;font-weight:bold\">ERROR</span>the project wiki</a> for more details",           
+                                    false );
+        }    
+    
+        function validate()
+        {
+            $this->_valid = (ini_get( "safe_mode" ) == "");
+            return( parent::validate());    
+        }
+    }
+    
+    class WizardChecks extends Action
+    {        
+        function perform()
+        {
+            // build the array with checks
+            $checks = Array(
+               "writeConfigFile" => new WizardWritableFileValidator( "config/config.properties.php" ),
+               "writeTmpFolder" => new WizardWritableFileValidator( "tmp" ),
+               "writeGalleryFolder" => new WizardWritableFileValidator( "gallery" ),
+               "php" => new WizardPhpVersionValidator(),
+               "sessions" => new WizardSessionFunctionsAvailableValidator(),
+               "mysql" => new WizardMySQLFunctionsAvailableValidator(),
+               "xml" => new WizardXmlFunctionsAvailableValidator(),
+               "safemode" => new WizardSafeModeValidator()
+            );
+            
+            // run the checks
+            $ok = true;
+            foreach( $checks as $id => $check ) {
+                $valid = $checks["$id"]->validate();
+                // if it doesn't validate but it's not critical, then we can proced too
+                if( !$checks["$id"]->isCritical())
+                    $valid = true;          
+                $ok = ($ok && $valid);
+            }
+            
+            // create the view and pass the results
+            $this->_view = new WizardView( "checks" );
+            $this->_view->setValue( "ok", $ok );
+            $this->_view->setValue( "checks", $checks );
+        }
+    }
 
     /**
      * Gets the information about the database from the user.
@@ -1271,78 +905,6 @@
         }
     }
 
-    //
-    // The following classes take care of updating the database to the last release
-    //
-    // Things that need to be done when going from 1.0 to 1.1:
-    //
-    // - new tables:
-    //   plog_blog_categories
-    //        id: int(10)
-    //        name: varchar(255)
-    //        description: varchar(255)
-    //        mangled_name: varchar(255)
-    //        properties: text
-    //        num_blogs: int(10)
-    //        num_active_blogs: int(10)
-    //
-    //    plog_global_articles_categories: 
-    //        id: int(10)
-    //        name: varchar(255)
-    //        mangled_name: varchar(255)
-    //        num_articles: int(10)
-    //        num_active_articles: int(10)
-    //        description: varchar(255)
-    //        properties: text
-    //
-    //   plog_phpbb2_users:
-    //        id: int(10)
-    //        phpbb_id: int(10)
-    //        full_name: varchar(255)
-    //        about: text
-    //        properties: text
-    //        resource_picture_id: int(10)
-    //        status: int(10)
-    //
-    // - tables to be removed:
-    //     plog_trackbacks
-    //
-    // - make modifications to some of the old tables:
-    //     plog_articles
-    //          num_comments: INT(10)
-    //          num_nonspam_comments: INT(10)
-    //          num_trackbacks: INT(10)
-    //          num_nonspam_trackbacks: INT(10)
-    //          global_category_id: INT(10)
-    //          in_summary_page: TINYINT(1)
-    //          
-    //     plog_articles_categories
-    //          num_articles: int(10)
-    //          num_published_articles: int(10)
-    //
-    //     plog_articles_comments
-    //          type: int(3)
-    //          blog_id: int(10)
-    //
-    //     plog_blogs
-    //          create_date: timestamp(14)
-    //          last_update_date: timestamp(14)
-    //          num_posts: int(10)
-    //          num_comments: int(10)
-    //          num_trackbacks: int(10)
-    //          show_in_summary: int(4)
-    //
-    //     plog_gallery_albums
-    //          num_resources: int(10)
-    //          num_children: int(10)
-    //
-    //     plog_mylinks_categories
-    //          num_links: int(10)          
-    //
-    //     plog_users
-    //          site_admin: int(10)
-    //
-
     class UpdateStepOne extends Action
     {
 
@@ -2025,7 +1587,7 @@
     // throw an error before the user gets countless errors
     // from Smarty
     if( !File::isWritable( TEMP_FOLDER ) || !File::isDir( TEMP_FOLDER )) {
-        print("<span style=\"color:red; font-size: 14px;\">Error</span><br/><br/>This wizard needs the ".TEMP_FOLDER." folder to be writable by the web server user.<br/><br/>Please correct that and try again.");
+        print("<span style=\"color:red; font-size: 14px;\">Error</span><br/><br/>This wizard needs the ".TEMP_FOLDER." folder to be writable by the web server user.<br/><br/>Please correct it and try again.");
         die();
     }
 



More information about the pLog-svn mailing list