summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDries Buytaert2006-07-13 13:14:25 (GMT)
committerDries Buytaert2006-07-13 13:14:25 (GMT)
commit1c75a210bdf85afeee33952fd50c1951999fecb4 (patch)
tree340e364ba1ea0e4f41c2cd7c80e66543caff8304
parente4e416d1f7037dbee8e06096a6c41368d011599c (diff)
- Patch #68926 by chx, jeremy, steven, eaton, webchick, amazon, neil, nedjo et al: an initial install system for Drupal core.
-rw-r--r--database/database.4.0.mysql885
-rw-r--r--database/database.4.1.mysql942
-rw-r--r--database/database.pgsql920
-rw-r--r--includes/bootstrap.inc21
-rw-r--r--includes/database.mysql.inc3
-rw-r--r--includes/database.mysqli.inc3
-rw-r--r--includes/database.pgsql.inc3
-rw-r--r--includes/install.inc435
-rw-r--r--includes/install.mysql.inc140
-rw-r--r--includes/install.mysqli.inc140
-rw-r--r--includes/module.inc41
-rw-r--r--includes/theme.inc74
-rw-r--r--install.php417
-rw-r--r--misc/maintenance.css8
-rw-r--r--modules/aggregator/aggregator.install58
-rw-r--r--modules/book/book.install17
-rw-r--r--modules/contact/contact.install18
-rw-r--r--modules/drupal/drupal.install29
-rw-r--r--modules/forum/forum.install16
-rw-r--r--modules/locale/locale.install37
-rw-r--r--modules/poll/poll.install34
-rw-r--r--modules/profile/profile.install34
-rw-r--r--modules/search/search.install32
-rw-r--r--modules/statistics/statistics.install21
-rw-r--r--modules/system/system.install (renamed from database/updates.inc)423
-rw-r--r--profiles/default.profile21
-rw-r--r--update.php6
27 files changed, 1977 insertions, 2801 deletions
diff --git a/database/database.4.0.mysql b/database/database.4.0.mysql
deleted file mode 100644
index c3c5004..0000000
--- a/database/database.4.0.mysql
+++ /dev/null
@@ -1,885 +0,0 @@
--- $Id$
-
---
--- Table structure for table 'access'
---
-CREATE TABLE access (
- aid int(10) NOT NULL auto_increment,
- mask varchar(255) NOT NULL default '',
- type varchar(255) NOT NULL default '',
- status tinyint(2) NOT NULL default '0',
- PRIMARY KEY (aid)
-);
-
---
--- Table structure for table 'accesslog'
---
-
-CREATE TABLE accesslog (
- aid int(10) NOT NULL auto_increment,
- sid varchar(32) NOT NULL default '',
- title varchar(255) default NULL,
- path varchar(255) default NULL,
- url varchar(255) default NULL,
- hostname varchar(128) default NULL,
- uid int(10) unsigned default '0',
- timer int(10) unsigned NOT NULL default '0',
- timestamp int(11) unsigned NOT NULL default '0',
- KEY accesslog_timestamp (timestamp),
- PRIMARY KEY (aid)
-);
-
---
--- Table structure for table 'aggregator_category'
---
-
-CREATE TABLE aggregator_category (
- cid int(10) NOT NULL auto_increment,
- title varchar(255) NOT NULL default '',
- description longtext NOT NULL,
- block tinyint(2) NOT NULL default '0',
- PRIMARY KEY (cid),
- UNIQUE KEY title (title)
-);
-
---
--- Table structure for table 'aggregator_category_feed'
---
-
-CREATE TABLE aggregator_category_feed (
- fid int(10) NOT NULL default '0',
- cid int(10) NOT NULL default '0',
- PRIMARY KEY (fid,cid)
-);
-
---
--- Table structure for table 'aggregator_category_item'
---
-
-CREATE TABLE aggregator_category_item (
- iid int(10) NOT NULL default '0',
- cid int(10) NOT NULL default '0',
- PRIMARY KEY (iid,cid)
-);
-
---
--- Table structure for table 'aggregator_feed'
---
-
-CREATE TABLE aggregator_feed (
- fid int(10) NOT NULL auto_increment,
- title varchar(255) NOT NULL default '',
- url varchar(255) NOT NULL default '',
- refresh int(10) NOT NULL default '0',
- checked int(10) NOT NULL default '0',
- link varchar(255) NOT NULL default '',
- description longtext NOT NULL,
- image longtext NOT NULL,
- etag varchar(255) NOT NULL default '',
- modified int(10) NOT NULL default '0',
- block tinyint(2) NOT NULL default '0',
- PRIMARY KEY (fid),
- UNIQUE KEY link (url),
- UNIQUE KEY title (title)
-);
-
---
--- Table structure for table 'aggregator_item'
---
-
-CREATE TABLE aggregator_item (
- iid int(10) NOT NULL auto_increment,
- fid int(10) NOT NULL default '0',
- title varchar(255) NOT NULL default '',
- link varchar(255) NOT NULL default '',
- author varchar(255) NOT NULL default '',
- description longtext NOT NULL,
- timestamp int(11) default NULL,
- PRIMARY KEY (iid)
-);
-
---
--- Table structure for table 'authmap'
---
-
-CREATE TABLE authmap (
- aid int(10) unsigned NOT NULL auto_increment,
- uid int(10) NOT NULL default '0',
- authname varchar(128) NOT NULL default '',
- module varchar(128) NOT NULL default '',
- PRIMARY KEY (aid),
- UNIQUE KEY authname (authname)
-);
-
---
--- Table structure for table 'blocks'
---
-
-CREATE TABLE blocks (
- module varchar(64) DEFAULT '' NOT NULL,
- delta varchar(32) NOT NULL default '0',
- theme varchar(255) NOT NULL default '',
- status tinyint(2) DEFAULT '0' NOT NULL,
- weight tinyint(1) DEFAULT '0' NOT NULL,
- region varchar(64) DEFAULT 'left' NOT NULL,
- custom tinyint(2) DEFAULT '0' NOT NULL,
- throttle tinyint(1) DEFAULT '0' NOT NULL,
- visibility tinyint(1) DEFAULT '0' NOT NULL,
- pages text DEFAULT '' NOT NULL
-);
-
---
--- Table structure for table 'book'
---
-
-CREATE TABLE book (
- vid int(10) unsigned NOT NULL default '0',
- nid int(10) unsigned NOT NULL default '0',
- parent int(10) NOT NULL default '0',
- weight tinyint(3) NOT NULL default '0',
- PRIMARY KEY (vid),
- KEY nid (nid),
- KEY parent (parent)
-);
-
---
--- Table structure for table 'boxes'
---
-
-CREATE TABLE boxes (
- bid int(4) NOT NULL auto_increment,
- title varchar(64) NOT NULL default '',
- body longtext,
- info varchar(128) NOT NULL default '',
- format int(4) NOT NULL default '0',
- PRIMARY KEY (bid),
- UNIQUE KEY info (info)
-);
-
---
--- Table structure for table 'cache'
---
-
-CREATE TABLE cache (
- cid varchar(255) NOT NULL default '',
- data longblob,
- expire int(11) NOT NULL default '0',
- created int(11) NOT NULL default '0',
- headers text,
- PRIMARY KEY (cid),
- INDEX expire (expire)
-);
-
---
--- Table structure for table 'comments'
---
-
-CREATE TABLE comments (
- cid int(10) NOT NULL auto_increment,
- pid int(10) NOT NULL default '0',
- nid int(10) NOT NULL default '0',
- uid int(10) NOT NULL default '0',
- subject varchar(64) NOT NULL default '',
- comment longtext NOT NULL,
- hostname varchar(128) NOT NULL default '',
- timestamp int(11) NOT NULL default '0',
- score mediumint(9) NOT NULL default '0',
- status tinyint(3) unsigned NOT NULL default '0',
- format int(4) NOT NULL default '0',
- thread varchar(255) NOT NULL,
- users longtext,
- name varchar(60) default NULL,
- mail varchar(64) default NULL,
- homepage varchar(255) default NULL,
- PRIMARY KEY (cid),
- KEY lid (nid)
-);
-
---
--- Table structre for table 'contact'
---
-
-CREATE TABLE contact (
- cid int(10) unsigned NOT NULL auto_increment,
- category varchar(255) NOT NULL default '',
- recipients longtext NOT NULL default '',
- reply longtext NOT NULL default '',
- weight tinyint(3) NOT NULL default '0',
- selected tinyint(1) NOT NULL default '0',
- PRIMARY KEY (cid),
- UNIQUE KEY category (category)
-);
-
---
--- Table structre for table 'node_comment_statistics'
---
-
-CREATE TABLE node_comment_statistics (
- nid int(10) unsigned NOT NULL auto_increment,
- last_comment_timestamp int(11) NOT NULL default '0',
- last_comment_name varchar(60) default NULL,
- last_comment_uid int(10) NOT NULL default '0',
- comment_count int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (nid),
- KEY node_comment_timestamp (last_comment_timestamp)
-);
-
---
--- Table structure for table 'client'
---
-
-CREATE TABLE client (
- cid int(10) unsigned NOT NULL auto_increment,
- link varchar(255) NOT NULL default '',
- name varchar(128) NOT NULL default '',
- mail varchar(128) NOT NULL default '',
- slogan longtext NOT NULL,
- mission longtext NOT NULL,
- users int(10) NOT NULL default '0',
- nodes int(10) NOT NULL default '0',
- version varchar(35) NOT NULL default'',
- created int(11) NOT NULL default '0',
- changed int(11) NOT NULL default '0',
- PRIMARY KEY (cid)
-);
-
---
--- Table structure for table 'client_system'
---
-
-CREATE TABLE client_system (
- cid int(10) NOT NULL default '0',
- name varchar(255) NOT NULL default '',
- type varchar(255) NOT NULL default '',
- PRIMARY KEY (cid,name)
-);
-
---
--- Table structure for table 'files'
---
-
-CREATE TABLE files (
- fid int(10) unsigned NOT NULL default 0,
- nid int(10) unsigned NOT NULL default 0,
- filename varchar(255) NOT NULL default '',
- filepath varchar(255) NOT NULL default '',
- filemime varchar(255) NOT NULL default '',
- filesize int(10) unsigned NOT NULL default 0,
- PRIMARY KEY (fid)
-);
-
---
--- Table structure for table 'file_revisions'
---
-
-CREATE TABLE file_revisions (
- fid int(10) unsigned NOT NULL default 0,
- vid int(10) unsigned NOT NULL default 0,
- description varchar(255) NOT NULL default '',
- list tinyint(1) unsigned NOT NULL default 0,
- PRIMARY KEY (fid, vid)
-);
-
---
--- Table structure for table 'filter_formats'
---
-
-CREATE TABLE filter_formats (
- format int(4) NOT NULL auto_increment,
- name varchar(255) NOT NULL default '',
- roles varchar(255) NOT NULL default '',
- cache tinyint(2) NOT NULL default '0',
- PRIMARY KEY (format),
- UNIQUE KEY (name)
-);
-
---
--- Table structure for table 'filters'
---
-
-CREATE TABLE filters (
- format int(4) NOT NULL default '0',
- module varchar(64) NOT NULL default '',
- delta tinyint(2) DEFAULT '0' NOT NULL,
- weight tinyint(2) DEFAULT '0' NOT NULL,
- INDEX (weight)
-);
-
---
--- Table structure for table 'flood'
---
-
-CREATE TABLE flood (
- event varchar(64) NOT NULL default '',
- hostname varchar(128) NOT NULL default '',
- timestamp int(11) NOT NULL default '0'
-);
-
---
--- Table structure for table 'forum'
---
-
-CREATE TABLE forum (
- nid int(10) unsigned NOT NULL default '0',
- vid int(10) unsigned NOT NULL default '0',
- tid int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (vid),
- KEY nid (nid),
- KEY tid (tid)
-);
-
---
--- Table structure for table 'history'
---
-
-CREATE TABLE history (
- uid int(10) NOT NULL default '0',
- nid int(10) NOT NULL default '0',
- timestamp int(11) NOT NULL default '0',
- PRIMARY KEY (uid,nid)
-);
-
---
--- Table structure for table 'locales_meta'
---
-
-CREATE TABLE locales_meta (
- locale varchar(12) NOT NULL default '',
- name varchar(64) NOT NULL default '',
- enabled int(2) NOT NULL default '0',
- isdefault int(2) NOT NULL default '0',
- plurals int(1) NOT NULL default '0',
- formula varchar(128) NOT NULL default '',
- PRIMARY KEY (locale)
-);
-
---
--- Table structure for table 'locales_source'
---
-
-CREATE TABLE locales_source (
- lid int(11) NOT NULL auto_increment,
- location varchar(255) NOT NULL default '',
- source blob NOT NULL,
- PRIMARY KEY (lid)
-);
-
---
--- Table structure for table 'locales_target'
---
-
-CREATE TABLE locales_target (
- lid int(11) NOT NULL default '0',
- translation blob NOT NULL,
- locale varchar(12) NOT NULL default '',
- plid int(11) NOT NULL default '0',
- plural int(1) NOT NULL default '0',
- KEY lid (lid),
- KEY lang (locale),
- KEY plid (plid),
- KEY plural (plural)
-);
-
---
--- Table structure for table 'menu'
---
-
-CREATE TABLE menu (
- mid int(10) unsigned NOT NULL default '0',
- pid int(10) unsigned NOT NULL default '0',
- path varchar(255) NOT NULL default '',
- title varchar(255) NOT NULL default '',
- description varchar(255) NOT NULL default '',
- weight tinyint(4) NOT NULL default '0',
- type int(2) unsigned NOT NULL default '0',
- PRIMARY KEY (mid)
-);
-
---
--- Table structure for table 'node'
---
-
-CREATE TABLE node (
- nid int(10) unsigned NOT NULL auto_increment,
- vid int(10) unsigned NOT NULL default '0',
- type varchar(32) NOT NULL default '',
- title varchar(128) NOT NULL default '',
- uid int(10) NOT NULL default '0',
- status int(4) NOT NULL default '1',
- created int(11) NOT NULL default '0',
- changed int(11) NOT NULL default '0',
- comment int(2) NOT NULL default '0',
- promote int(2) NOT NULL default '0',
- moderate int(2) NOT NULL default '0',
- sticky int(2) NOT NULL default '0',
- PRIMARY KEY (nid, vid),
- UNIQUE KEY vid (vid),
- KEY node_type (type(4)),
- KEY node_title_type (title, type(4)),
- KEY status (status),
- KEY uid (uid),
- KEY node_moderate (moderate),
- KEY node_promote_status (promote, status),
- KEY node_created (created),
- KEY node_changed (changed),
- KEY node_status_type (status, type, nid),
- KEY nid (nid)
-);
-
---
--- Table structure for table `node_access`
---
-
-CREATE TABLE node_access (
- nid int(10) unsigned NOT NULL default '0',
- gid int(10) unsigned NOT NULL default '0',
- realm varchar(255) NOT NULL default '',
- grant_view tinyint(1) unsigned NOT NULL default '0',
- grant_update tinyint(1) unsigned NOT NULL default '0',
- grant_delete tinyint(1) unsigned NOT NULL default '0',
- PRIMARY KEY (nid,gid,realm)
-);
-
---
--- Table structure for table 'node_revisions'
---
-
-CREATE TABLE node_revisions (
- nid int(10) unsigned NOT NULL,
- vid int(10) unsigned NOT NULL,
- uid int(10) NOT NULL default '0',
- title varchar(128) NOT NULL default '',
- body longtext NOT NULL default '',
- teaser longtext NOT NULL default '',
- log longtext NOT NULL default '',
- timestamp int(11) NOT NULL default '0',
- format int(4) NOT NULL default '0',
- PRIMARY KEY (vid),
- KEY nid (nid),
- KEY uid (uid)
-);
-
---
--- Table structure for table 'profile_fields'
---
-
-CREATE TABLE profile_fields (
- fid int(10) NOT NULL auto_increment,
- title varchar(255) default NULL,
- name varchar(128) default NULL,
- explanation TEXT default NULL,
- category varchar(255) default NULL,
- page varchar(255) default NULL,
- type varchar(128) default NULL,
- weight tinyint(1) DEFAULT '0' NOT NULL,
- required tinyint(1) DEFAULT '0' NOT NULL,
- register tinyint(1) DEFAULT '0' NOT NULL,
- visibility tinyint(1) DEFAULT '0' NOT NULL,
- autocomplete tinyint(1) DEFAULT '0' NOT NULL,
- options text,
- KEY category (category),
- UNIQUE KEY name (name),
- PRIMARY KEY (fid)
-);
-
---
--- Table structure for table 'profile_values'
---
-
-CREATE TABLE profile_values (
- fid int(10) unsigned default '0',
- uid int(10) unsigned default '0',
- value text,
- KEY uid (uid),
- KEY fid (fid)
-);
-
-
---
--- Table structure for table 'url_alias'
---
-
-CREATE TABLE url_alias (
- pid int(10) unsigned NOT NULL auto_increment,
- src varchar(128) NOT NULL default '',
- dst varchar(128) NOT NULL default '',
- PRIMARY KEY (pid),
- UNIQUE KEY dst (dst),
- KEY src (src)
-);
-
---
--- Table structure for table 'permission'
---
-
-CREATE TABLE permission (
- rid int(10) unsigned NOT NULL default '0',
- perm longtext,
- tid int(10) unsigned NOT NULL default '0',
- KEY rid (rid)
-);
-
---
--- Table structure for table 'poll'
---
-
-CREATE TABLE poll (
- nid int(10) unsigned NOT NULL default '0',
- runtime int(10) NOT NULL default '0',
- active int(2) unsigned NOT NULL default '0',
- PRIMARY KEY (nid)
-);
-
---
--- Table structure for table 'poll_votes'
---
-
-CREATE TABLE poll_votes (
- nid int(10) unsigned NOT NULL,
- uid int(10) unsigned NOT NULL default 0,
- chorder int(10) NOT NULL default -1,
- hostname varchar(128) NOT NULL default '',
- INDEX (nid),
- INDEX (uid),
- INDEX (hostname)
-);
-
---
--- Table structure for table 'poll_choices'
---
-
-CREATE TABLE poll_choices (
- chid int(10) unsigned NOT NULL auto_increment,
- nid int(10) unsigned NOT NULL default '0',
- chtext varchar(128) NOT NULL default '',
- chvotes int(6) NOT NULL default '0',
- chorder int(2) NOT NULL default '0',
- PRIMARY KEY (chid),
- KEY nid (nid)
-);
-
---
--- Table structure for table 'role'
---
-
-CREATE TABLE role (
- rid int(10) unsigned NOT NULL auto_increment,
- name varchar(32) NOT NULL default '',
- PRIMARY KEY (rid),
- UNIQUE KEY name (name)
-);
-
---
--- Table structure for table 'blocks_roles'
---
-CREATE TABLE blocks_roles (
- module varchar(64) NOT NULL,
- delta varchar(32) NOT NULL,
- rid int(10) unsigned NOT NULL,
- PRIMARY KEY (module, delta, rid)
-)
-/*!40100 DEFAULT CHARACTER SET utf8 */ ;
-
---
--- Table structure for table 'search_dataset'
---
-CREATE TABLE search_dataset (
- sid int(10) unsigned NOT NULL default '0',
- type varchar(16) default NULL,
- data longtext NOT NULL,
- KEY sid_type (sid, type)
-);
-
---
--- Table structure for table 'search_index'
---
-
-CREATE TABLE search_index (
- word varchar(50) NOT NULL default '',
- sid int(10) unsigned NOT NULL default '0',
- type varchar(16) default NULL,
- fromsid int(10) unsigned NOT NULL default '0',
- fromtype varchar(16) default NULL,
- score float default NULL,
- KEY sid_type (sid, type),
- KEY from_sid_type (fromsid, fromtype),
- KEY word (word)
-);
-
---
--- Table structure for table 'search_total'
---
-
-CREATE TABLE search_total (
- word varchar(50) NOT NULL default '',
- count float default NULL,
- PRIMARY KEY (word)
-);
-
---
--- Table structure for table 'sessions'
---
-
-
-CREATE TABLE sessions (
- uid int(10) unsigned NOT NULL,
- sid varchar(32) NOT NULL default '',
- hostname varchar(128) NOT NULL default '',
- timestamp int(11) NOT NULL default '0',
- cache int(11) NOT NULL default '0',
- session longtext,
- KEY uid (uid),
- PRIMARY KEY (sid),
- KEY timestamp (timestamp)
-);
-
---
--- Table structure for table 'sequences'
---
-
-CREATE TABLE sequences (
- name varchar(255) NOT NULL default '',
- id int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (name)
-);
-
---
--- Table structure for table 'node_counter'
---
-
-CREATE TABLE node_counter (
- nid int(10) NOT NULL default '0',
- totalcount bigint(20) unsigned NOT NULL default '0',
- daycount mediumint(8) unsigned NOT NULL default '0',
- timestamp int(11) unsigned NOT NULL default '0',
- PRIMARY KEY (nid),
- KEY totalcount (totalcount),
- KEY daycount (daycount),
- KEY timestamp (timestamp)
-);
-
---
--- Table structure for table 'system'
---
-
-CREATE TABLE system (
- filename varchar(255) NOT NULL default '',
- name varchar(255) NOT NULL default '',
- type varchar(255) NOT NULL default '',
- description varchar(255) NOT NULL default '',
- status int(2) NOT NULL default '0',
- throttle tinyint(1) DEFAULT '0' NOT NULL,
- bootstrap int(2) NOT NULL default '0',
- schema_version smallint(3) NOT NULL default -1,
- weight int(2) NOT NULL default '0',
- PRIMARY KEY (filename),
- KEY (weight)
-);
-
---
--- Table structure for table 'term_data'
---
-
-CREATE TABLE term_data (
- tid int(10) unsigned NOT NULL auto_increment,
- vid int(10) unsigned NOT NULL default '0',
- name varchar(255) NOT NULL default '',
- description longtext,
- weight tinyint(4) NOT NULL default '0',
- PRIMARY KEY (tid),
- KEY vid (vid)
-);
-
---
--- Table structure for table 'term_hierarchy'
---
-
-CREATE TABLE term_hierarchy (
- tid int(10) unsigned NOT NULL default '0',
- parent int(10) unsigned NOT NULL default '0',
- KEY tid (tid),
- KEY parent (parent),
- PRIMARY KEY (tid, parent)
-);
-
---
--- Table structure for table 'term_node'
---
-
-CREATE TABLE term_node (
- nid int(10) unsigned NOT NULL default '0',
- tid int(10) unsigned NOT NULL default '0',
- KEY nid (nid),
- KEY tid (tid),
- PRIMARY KEY (tid,nid)
-);
-
---
--- Table structure for table 'term_relation'
---
-
-CREATE TABLE term_relation (
- tid1 int(10) unsigned NOT NULL default '0',
- tid2 int(10) unsigned NOT NULL default '0',
- KEY tid1 (tid1),
- KEY tid2 (tid2)
-);
-
---
--- Table structure for table 'term_synonym'
---
-
-CREATE TABLE term_synonym (
- tid int(10) unsigned NOT NULL default '0',
- name varchar(255) NOT NULL default '',
- KEY tid (tid),
- KEY name (name(3))
-);
-
---
--- Table structure for table 'users'
---
-
-CREATE TABLE users (
- uid int(10) unsigned NOT NULL default '0',
- name varchar(60) NOT NULL default '',
- pass varchar(32) NOT NULL default '',
- mail varchar(64) default '',
- mode tinyint(1) NOT NULL default '0',
- sort tinyint(1) default '0',
- threshold tinyint(1) default '0',
- theme varchar(255) NOT NULL default '',
- signature varchar(255) NOT NULL default '',
- created int(11) NOT NULL default '0',
- access int(11) NOT NULL default '0',
- login int(11) NOT NULL default '0',
- status tinyint(4) NOT NULL default '0',
- timezone varchar(8) default NULL,
- language varchar(12) NOT NULL default '',
- picture varchar(255) NOT NULL DEFAULT '',
- init varchar(64) default '',
- data longtext,
- PRIMARY KEY (uid),
- UNIQUE KEY name (name),
- KEY access (access)
-);
-
---
--- Table structure for table 'users_roles'
---
-
-CREATE TABLE users_roles (
- uid int(10) unsigned NOT NULL default '0',
- rid int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (uid, rid)
-);
-
---
--- Table structure for table 'variable'
---
-
-CREATE TABLE variable (
- name varchar(48) NOT NULL default '',
- value longtext NOT NULL,
- PRIMARY KEY (name)
-);
-
---
--- Table structure for table 'vocabulary'
---
-
-CREATE TABLE vocabulary (
- vid int(10) unsigned NOT NULL auto_increment,
- name varchar(255) NOT NULL default '',
- description longtext,
- help varchar(255) NOT NULL default '',
- relations tinyint(3) unsigned NOT NULL default '0',
- hierarchy tinyint(3) unsigned NOT NULL default '0',
- multiple tinyint(3) unsigned NOT NULL default '0',
- required tinyint(3) unsigned NOT NULL default '0',
- tags tinyint(3) unsigned NOT NULL default '0',
- module varchar(255) NOT NULL default '',
- weight tinyint(4) NOT NULL default '0',
- PRIMARY KEY (vid)
-);
-
---
--- Table structure for table 'vocabulary_node_types'
---
-
-CREATE TABLE vocabulary_node_types (
- vid int(10) unsigned NOT NULL DEFAULT '0',
- type varchar(32) NOT NULL DEFAULT '',
- PRIMARY KEY (vid, type)
-);
-
---
--- Table structure for table 'watchdog'
---
-
-CREATE TABLE watchdog (
- wid int(5) NOT NULL auto_increment,
- uid int(10) NOT NULL default '0',
- type varchar(16) NOT NULL default '',
- message longtext NOT NULL,
- severity tinyint(3) unsigned NOT NULL default '0',
- link varchar(255) NOT NULL default '',
- location varchar(128) NOT NULL default '',
- referer varchar(128) NOT NULL default '',
- hostname varchar(128) NOT NULL default '',
- timestamp int(11) NOT NULL default '0',
- PRIMARY KEY (wid)
-);
-
---
--- Insert some default values
---
-
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/block/block.module', 'block', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/comment/comment.module', 'comment', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/filter/filter.module', 'filter', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/help/help.module', 'help', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/menu/menu.module', 'menu', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/node/node.module', 'node', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/page/page.module', 'page', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/story/story.module', 'story', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/system/system.module', 'system', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/taxonomy/taxonomy.module', 'taxonomy', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/user/user.module', 'user', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/watchdog/watchdog.module', 'watchdog', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('themes/engines/phptemplate/phptemplate.engine', 'phptemplate', 'theme_engine', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('themes/bluemarine/page.tpl.php', 'bluemarine', 'theme', 'themes/engines/phptemplate/phptemplate.engine', 1, 0, 0, 0);
-INSERT INTO users (uid, name, mail) VALUES ('0', '', '');
-
-INSERT INTO role (rid, name) VALUES (1, 'anonymous user');
-INSERT INTO role (rid, name) VALUES (2, 'authenticated user');
-
-INSERT INTO permission VALUES (1,'access content',0);
-INSERT INTO permission VALUES (2,'access comments, access content, post comments, post comments without approval',0);
-
-INSERT INTO variable (name, value) VALUES ('theme_default', 's:10:"bluemarine";');
-
-INSERT INTO blocks (module, delta, theme, status, pages) VALUES ('user', '0', 'bluemarine', '1', '');
-INSERT INTO blocks (module, delta, theme, status, pages) VALUES ('user', '1', 'bluemarine', '1', '');
-
-INSERT INTO sequences (name, id) VALUES ('menu_mid', 2);
-
-INSERT INTO node_access VALUES (0, 0, 'all', 1, 0, 0);
-
-INSERT INTO filter_formats VALUES (1,'Filtered HTML',',1,2,',1);
-INSERT INTO filter_formats VALUES (2,'PHP code','',0);
-INSERT INTO filter_formats VALUES (3,'Full HTML','',1);
-INSERT INTO filters VALUES (1,'filter',0,0);
-INSERT INTO filters VALUES (1,'filter',2,1);
-INSERT INTO filters VALUES (2,'filter',1,0);
-INSERT INTO filters VALUES (3,'filter',2,0);
-INSERT INTO variable (name,value) VALUES ('filter_html_1','i:1;');
-
-INSERT INTO locales_meta (locale, name, enabled, isdefault) VALUES ('en', 'English', '1', '1');
-
-INSERT INTO variable (name, value) VALUES ('node_options_forum', 'a:1:{i:0;s:6:"status";}');
-
-INSERT INTO menu VALUES (2, 0, '', 'Primary links', '', 0, 115);
-INSERT INTO variable VALUES ('menu_primary_menu', 'i:2;');
-INSERT INTO variable VALUES ('menu_secondary_menu', 'i:2;');
-
diff --git a/database/database.4.1.mysql b/database/database.4.1.mysql
deleted file mode 100644
index 1a41c24..0000000
--- a/database/database.4.1.mysql
+++ /dev/null
@@ -1,942 +0,0 @@
--- $Id$
-
---
--- Table structure for table 'access'
---
-CREATE TABLE access (
- aid int(10) NOT NULL auto_increment,
- mask varchar(255) NOT NULL default '',
- type varchar(255) NOT NULL default '',
- status tinyint(2) NOT NULL default '0',
- PRIMARY KEY (aid)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'accesslog'
---
-
-CREATE TABLE accesslog (
- aid int(10) NOT NULL auto_increment,
- sid varchar(32) NOT NULL default '',
- title varchar(255) default NULL,
- path varchar(255) default NULL,
- url varchar(255) default NULL,
- hostname varchar(128) default NULL,
- uid int(10) unsigned default '0',
- timer int(10) unsigned NOT NULL default '0',
- timestamp int(11) unsigned NOT NULL default '0',
- KEY accesslog_timestamp (timestamp),
- PRIMARY KEY (aid)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'aggregator_category'
---
-
-CREATE TABLE aggregator_category (
- cid int(10) NOT NULL auto_increment,
- title varchar(255) NOT NULL default '',
- description longtext NOT NULL,
- block tinyint(2) NOT NULL default '0',
- PRIMARY KEY (cid),
- UNIQUE KEY title (title)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'aggregator_category_feed'
---
-
-CREATE TABLE aggregator_category_feed (
- fid int(10) NOT NULL default '0',
- cid int(10) NOT NULL default '0',
- PRIMARY KEY (fid,cid)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'aggregator_category_item'
---
-
-CREATE TABLE aggregator_category_item (
- iid int(10) NOT NULL default '0',
- cid int(10) NOT NULL default '0',
- PRIMARY KEY (iid,cid)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'aggregator_feed'
---
-
-CREATE TABLE aggregator_feed (
- fid int(10) NOT NULL auto_increment,
- title varchar(255) NOT NULL default '',
- url varchar(255) NOT NULL default '',
- refresh int(10) NOT NULL default '0',
- checked int(10) NOT NULL default '0',
- link varchar(255) NOT NULL default '',
- description longtext NOT NULL,
- image longtext NOT NULL,
- etag varchar(255) NOT NULL default '',
- modified int(10) NOT NULL default '0',
- block tinyint(2) NOT NULL default '0',
- PRIMARY KEY (fid),
- UNIQUE KEY link (url),
- UNIQUE KEY title (title)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'aggregator_item'
---
-
-CREATE TABLE aggregator_item (
- iid int(10) NOT NULL auto_increment,
- fid int(10) NOT NULL default '0',
- title varchar(255) NOT NULL default '',
- link varchar(255) NOT NULL default '',
- author varchar(255) NOT NULL default '',
- description longtext NOT NULL,
- timestamp int(11) default NULL,
- PRIMARY KEY (iid)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'authmap'
---
-
-CREATE TABLE authmap (
- aid int(10) unsigned NOT NULL auto_increment,
- uid int(10) NOT NULL default '0',
- authname varchar(128) NOT NULL default '',
- module varchar(128) NOT NULL default '',
- PRIMARY KEY (aid),
- UNIQUE KEY authname (authname)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'blocks'
---
-
-CREATE TABLE blocks (
- module varchar(64) DEFAULT '' NOT NULL,
- delta varchar(32) NOT NULL default '0',
- theme varchar(255) NOT NULL default '',
- status tinyint(2) DEFAULT '0' NOT NULL,
- weight tinyint(1) DEFAULT '0' NOT NULL,
- region varchar(64) DEFAULT 'left' NOT NULL,
- custom tinyint(2) DEFAULT '0' NOT NULL,
- throttle tinyint(1) DEFAULT '0' NOT NULL,
- visibility tinyint(1) DEFAULT '0' NOT NULL,
- pages text DEFAULT '' NOT NULL
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'book'
---
-
-CREATE TABLE book (
- vid int(10) unsigned NOT NULL default '0',
- nid int(10) unsigned NOT NULL default '0',
- parent int(10) NOT NULL default '0',
- weight tinyint(3) NOT NULL default '0',
- PRIMARY KEY (vid),
- KEY nid (nid),
- KEY parent (parent)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'boxes'
---
-
-CREATE TABLE boxes (
- bid int(4) NOT NULL auto_increment,
- title varchar(64) NOT NULL default '',
- body longtext,
- info varchar(128) NOT NULL default '',
- format int(4) NOT NULL default '0',
- PRIMARY KEY (bid),
- UNIQUE KEY info (info)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'cache'
---
-
-CREATE TABLE cache (
- cid varchar(255) NOT NULL default '',
- data longblob,
- expire int(11) NOT NULL default '0',
- created int(11) NOT NULL default '0',
- headers text,
- PRIMARY KEY (cid),
- INDEX expire (expire)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'comments'
---
-
-CREATE TABLE comments (
- cid int(10) NOT NULL auto_increment,
- pid int(10) NOT NULL default '0',
- nid int(10) NOT NULL default '0',
- uid int(10) NOT NULL default '0',
- subject varchar(64) NOT NULL default '',
- comment longtext NOT NULL,
- hostname varchar(128) NOT NULL default '',
- timestamp int(11) NOT NULL default '0',
- score mediumint(9) NOT NULL default '0',
- status tinyint(3) unsigned NOT NULL default '0',
- format int(4) NOT NULL default '0',
- thread varchar(255) NOT NULL,
- users longtext,
- name varchar(60) default NULL,
- mail varchar(64) default NULL,
- homepage varchar(255) default NULL,
- PRIMARY KEY (cid),
- KEY lid (nid)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structre for table 'contact'
---
-
-CREATE TABLE contact (
- cid int(10) unsigned NOT NULL auto_increment,
- category varchar(255) NOT NULL default '',
- recipients longtext NOT NULL default '',
- reply longtext NOT NULL default '',
- weight tinyint(3) NOT NULL default '0',
- selected tinyint(1) NOT NULL default '0',
- PRIMARY KEY (cid),
- UNIQUE KEY category (category)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structre for table 'node_comment_statistics'
---
-
-CREATE TABLE node_comment_statistics (
- nid int(10) unsigned NOT NULL auto_increment,
- last_comment_timestamp int(11) NOT NULL default '0',
- last_comment_name varchar(60) default NULL,
- last_comment_uid int(10) NOT NULL default '0',
- comment_count int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (nid),
- KEY node_comment_timestamp (last_comment_timestamp)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'client'
---
-
-CREATE TABLE client (
- cid int(10) unsigned NOT NULL auto_increment,
- link varchar(255) NOT NULL default '',
- name varchar(128) NOT NULL default '',
- mail varchar(128) NOT NULL default '',
- slogan longtext NOT NULL,
- mission longtext NOT NULL,
- users int(10) NOT NULL default '0',
- nodes int(10) NOT NULL default '0',
- version varchar(35) NOT NULL default'',
- created int(11) NOT NULL default '0',
- changed int(11) NOT NULL default '0',
- PRIMARY KEY (cid)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'client_system'
---
-
-CREATE TABLE client_system (
- cid int(10) NOT NULL default '0',
- name varchar(255) NOT NULL default '',
- type varchar(255) NOT NULL default '',
- PRIMARY KEY (cid,name)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'files'
---
-
-CREATE TABLE files (
- fid int(10) unsigned NOT NULL default 0,
- nid int(10) unsigned NOT NULL default 0,
- filename varchar(255) NOT NULL default '',
- filepath varchar(255) NOT NULL default '',
- filemime varchar(255) NOT NULL default '',
- filesize int(10) unsigned NOT NULL default 0,
- PRIMARY KEY (fid)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'file_revisions'
---
-
-CREATE TABLE file_revisions (
- fid int(10) unsigned NOT NULL default 0,
- vid int(10) unsigned NOT NULL default 0,
- description varchar(255) NOT NULL default '',
- list tinyint(1) unsigned NOT NULL default 0,
- PRIMARY KEY (fid, vid)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'filter_formats'
---
-
-CREATE TABLE filter_formats (
- format int(4) NOT NULL auto_increment,
- name varchar(255) NOT NULL default '',
- roles varchar(255) NOT NULL default '',
- cache tinyint(2) NOT NULL default '0',
- PRIMARY KEY (format),
- UNIQUE KEY (name)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'filters'
---
-
-CREATE TABLE filters (
- format int(4) NOT NULL default '0',
- module varchar(64) NOT NULL default '',
- delta tinyint(2) DEFAULT '0' NOT NULL,
- weight tinyint(2) DEFAULT '0' NOT NULL,
- INDEX (weight)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'flood'
---
-
-CREATE TABLE flood (
- event varchar(64) NOT NULL default '',
- hostname varchar(128) NOT NULL default '',
- timestamp int(11) NOT NULL default '0'
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'forum'
---
-
-CREATE TABLE forum (
- nid int(10) unsigned NOT NULL default '0',
- vid int(10) unsigned NOT NULL default '0',
- tid int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (vid),
- KEY nid (nid),
- KEY tid (tid)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'history'
---
-
-CREATE TABLE history (
- uid int(10) NOT NULL default '0',
- nid int(10) NOT NULL default '0',
- timestamp int(11) NOT NULL default '0',
- PRIMARY KEY (uid,nid)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'locales_meta'
---
-
-CREATE TABLE locales_meta (
- locale varchar(12) NOT NULL default '',
- name varchar(64) NOT NULL default '',
- enabled int(2) NOT NULL default '0',
- isdefault int(2) NOT NULL default '0',
- plurals int(1) NOT NULL default '0',
- formula varchar(128) NOT NULL default '',
- PRIMARY KEY (locale)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'locales_source'
---
-
-CREATE TABLE locales_source (
- lid int(11) NOT NULL auto_increment,
- location varchar(255) NOT NULL default '',
- source blob NOT NULL,
- PRIMARY KEY (lid)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'locales_target'
---
-
-CREATE TABLE locales_target (
- lid int(11) NOT NULL default '0',
- translation blob NOT NULL,
- locale varchar(12) NOT NULL default '',
- plid int(11) NOT NULL default '0',
- plural int(1) NOT NULL default '0',
- KEY lid (lid),
- KEY lang (locale),
- KEY plid (plid),
- KEY plural (plural)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'menu'
---
-
-CREATE TABLE menu (
- mid int(10) unsigned NOT NULL default '0',
- pid int(10) unsigned NOT NULL default '0',
- path varchar(255) NOT NULL default '',
- title varchar(255) NOT NULL default '',
- description varchar(255) NOT NULL default '',
- weight tinyint(4) NOT NULL default '0',
- type int(2) unsigned NOT NULL default '0',
- PRIMARY KEY (mid)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'node'
---
-
-CREATE TABLE node (
- nid int(10) unsigned NOT NULL auto_increment,
- vid int(10) unsigned NOT NULL default '0',
- type varchar(32) NOT NULL default '',
- title varchar(128) NOT NULL default '',
- uid int(10) NOT NULL default '0',
- status int(4) NOT NULL default '1',
- created int(11) NOT NULL default '0',
- changed int(11) NOT NULL default '0',
- comment int(2) NOT NULL default '0',
- promote int(2) NOT NULL default '0',
- moderate int(2) NOT NULL default '0',
- sticky int(2) NOT NULL default '0',
- PRIMARY KEY (nid, vid),
- UNIQUE KEY vid (vid),
- KEY node_type (type(4)),
- KEY node_title_type (title, type(4)),
- KEY status (status),
- KEY uid (uid),
- KEY node_moderate (moderate),
- KEY node_promote_status (promote, status),
- KEY node_created (created),
- KEY node_changed (changed),
- KEY node_status_type (status, type, nid),
- KEY nid (nid)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table `node_access`
---
-
-CREATE TABLE node_access (
- nid int(10) unsigned NOT NULL default '0',
- gid int(10) unsigned NOT NULL default '0',
- realm varchar(255) NOT NULL default '',
- grant_view tinyint(1) unsigned NOT NULL default '0',
- grant_update tinyint(1) unsigned NOT NULL default '0',
- grant_delete tinyint(1) unsigned NOT NULL default '0',
- PRIMARY KEY (nid,gid,realm)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'node_revisions'
---
-
-CREATE TABLE node_revisions (
- nid int(10) unsigned NOT NULL,
- vid int(10) unsigned NOT NULL,
- uid int(10) NOT NULL default '0',
- title varchar(128) NOT NULL default '',
- body longtext NOT NULL default '',
- teaser longtext NOT NULL default '',
- log longtext NOT NULL default '',
- timestamp int(11) NOT NULL default '0',
- format int(4) NOT NULL default '0',
- PRIMARY KEY (vid),
- KEY nid (nid),
- KEY uid (uid)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'profile_fields'
---
-
-CREATE TABLE profile_fields (
- fid int(10) NOT NULL auto_increment,
- title varchar(255) default NULL,
- name varchar(128) default NULL,
- explanation TEXT default NULL,
- category varchar(255) default NULL,
- page varchar(255) default NULL,
- type varchar(128) default NULL,
- weight tinyint(1) DEFAULT '0' NOT NULL,
- required tinyint(1) DEFAULT '0' NOT NULL,
- register tinyint(1) DEFAULT '0' NOT NULL,
- visibility tinyint(1) DEFAULT '0' NOT NULL,
- autocomplete tinyint(1) DEFAULT '0' NOT NULL,
- options text,
- KEY category (category),
- UNIQUE KEY name (name),
- PRIMARY KEY (fid)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'profile_values'
---
-
-CREATE TABLE profile_values (
- fid int(10) unsigned default '0',
- uid int(10) unsigned default '0',
- value text,
- KEY uid (uid),
- KEY fid (fid)
-)
-DEFAULT CHARACTER SET utf8;
-
-
---
--- Table structure for table 'url_alias'
---
-
-CREATE TABLE url_alias (
- pid int(10) unsigned NOT NULL auto_increment,
- src varchar(128) NOT NULL default '',
- dst varchar(128) NOT NULL default '',
- PRIMARY KEY (pid),
- UNIQUE KEY dst (dst),
- KEY src (src)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'permission'
---
-
-CREATE TABLE permission (
- rid int(10) unsigned NOT NULL default '0',
- perm longtext,
- tid int(10) unsigned NOT NULL default '0',
- KEY rid (rid)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'poll'
---
-
-CREATE TABLE poll (
- nid int(10) unsigned NOT NULL default '0',
- runtime int(10) NOT NULL default '0',
- active int(2) unsigned NOT NULL default '0',
- PRIMARY KEY (nid)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'poll_votes'
---
-
-CREATE TABLE poll_votes (
- nid int(10) unsigned NOT NULL,
- uid int(10) unsigned NOT NULL default 0,
- chorder int(10) NOT NULL default -1,
- hostname varchar(128) NOT NULL default '',
- INDEX (nid),
- INDEX (uid),
- INDEX (hostname)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'poll_choices'
---
-
-CREATE TABLE poll_choices (
- chid int(10) unsigned NOT NULL auto_increment,
- nid int(10) unsigned NOT NULL default '0',
- chtext varchar(128) NOT NULL default '',
- chvotes int(6) NOT NULL default '0',
- chorder int(2) NOT NULL default '0',
- PRIMARY KEY (chid),
- KEY nid (nid)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'role'
---
-
-CREATE TABLE role (
- rid int(10) unsigned NOT NULL auto_increment,
- name varchar(32) NOT NULL default '',
- PRIMARY KEY (rid),
- UNIQUE KEY name (name)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'blocks_roles'
---
-CREATE TABLE blocks_roles (
- module varchar(64) NOT NULL,
- delta varchar(32) NOT NULL,
- rid int(10) unsigned NOT NULL,
- PRIMARY KEY (module, delta, rid)
-)
-/*!40100 DEFAULT CHARACTER SET utf8 */ ;
-
---
--- Table structure for table 'search_dataset'
---
-CREATE TABLE search_dataset (
- sid int(10) unsigned NOT NULL default '0',
- type varchar(16) default NULL,
- data longtext NOT NULL,
- KEY sid_type (sid, type)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'search_index'
---
-
-CREATE TABLE search_index (
- word varchar(50) NOT NULL default '',
- sid int(10) unsigned NOT NULL default '0',
- type varchar(16) default NULL,
- fromsid int(10) unsigned NOT NULL default '0',
- fromtype varchar(16) default NULL,
- score float default NULL,
- KEY sid_type (sid, type),
- KEY from_sid_type (fromsid, fromtype),
- KEY word (word)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'search_total'
---
-
-CREATE TABLE search_total (
- word varchar(50) NOT NULL default '',
- count float default NULL,
- PRIMARY KEY (word)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'sessions'
---
-
-
-CREATE TABLE sessions (
- uid int(10) unsigned NOT NULL,
- sid varchar(32) NOT NULL default '',
- hostname varchar(128) NOT NULL default '',
- timestamp int(11) NOT NULL default '0',
- cache int(11) NOT NULL default '0',
- session longtext,
- KEY uid (uid),
- PRIMARY KEY (sid),
- KEY timestamp (timestamp)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'sequences'
---
-
-CREATE TABLE sequences (
- name varchar(255) NOT NULL default '',
- id int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (name)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'node_counter'
---
-
-CREATE TABLE node_counter (
- nid int(10) NOT NULL default '0',
- totalcount bigint(20) unsigned NOT NULL default '0',
- daycount mediumint(8) unsigned NOT NULL default '0',
- timestamp int(11) unsigned NOT NULL default '0',
- PRIMARY KEY (nid),
- KEY totalcount (totalcount),
- KEY daycount (daycount),
- KEY timestamp (timestamp)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'system'
---
-
-CREATE TABLE system (
- filename varchar(255) NOT NULL default '',
- name varchar(255) NOT NULL default '',
- type varchar(255) NOT NULL default '',
- description varchar(255) NOT NULL default '',
- status int(2) NOT NULL default '0',
- throttle tinyint(1) DEFAULT '0' NOT NULL,
- bootstrap int(2) NOT NULL default '0',
- schema_version smallint(3) NOT NULL default -1,
- weight int(2) NOT NULL default '0',
- PRIMARY KEY (filename),
- KEY (weight)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'term_data'
---
-
-CREATE TABLE term_data (
- tid int(10) unsigned NOT NULL auto_increment,
- vid int(10) unsigned NOT NULL default '0',
- name varchar(255) NOT NULL default '',
- description longtext,
- weight tinyint(4) NOT NULL default '0',
- PRIMARY KEY (tid),
- KEY vid (vid)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'term_hierarchy'
---
-
-CREATE TABLE term_hierarchy (
- tid int(10) unsigned NOT NULL default '0',
- parent int(10) unsigned NOT NULL default '0',
- KEY tid (tid),
- KEY parent (parent),
- PRIMARY KEY (tid, parent)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'term_node'
---
-
-CREATE TABLE term_node (
- nid int(10) unsigned NOT NULL default '0',
- tid int(10) unsigned NOT NULL default '0',
- KEY nid (nid),
- KEY tid (tid),
- PRIMARY KEY (tid,nid)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'term_relation'
---
-
-CREATE TABLE term_relation (
- tid1 int(10) unsigned NOT NULL default '0',
- tid2 int(10) unsigned NOT NULL default '0',
- KEY tid1 (tid1),
- KEY tid2 (tid2)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'term_synonym'
---
-
-CREATE TABLE term_synonym (
- tid int(10) unsigned NOT NULL default '0',
- name varchar(255) NOT NULL default '',
- KEY tid (tid),
- KEY name (name(3))
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'users'
---
-
-CREATE TABLE users (
- uid int(10) unsigned NOT NULL default '0',
- name varchar(60) NOT NULL default '',
- pass varchar(32) NOT NULL default '',
- mail varchar(64) default '',
- mode tinyint(1) NOT NULL default '0',
- sort tinyint(1) default '0',
- threshold tinyint(1) default '0',
- theme varchar(255) NOT NULL default '',
- signature varchar(255) NOT NULL default '',
- created int(11) NOT NULL default '0',
- access int(11) NOT NULL default '0',
- login int(11) NOT NULL default '0',
- status tinyint(4) NOT NULL default '0',
- timezone varchar(8) default NULL,
- language varchar(12) NOT NULL default '',
- picture varchar(255) NOT NULL DEFAULT '',
- init varchar(64) default '',
- data longtext,
- PRIMARY KEY (uid),
- UNIQUE KEY name (name),
- KEY access (access)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'users_roles'
---
-
-CREATE TABLE users_roles (
- uid int(10) unsigned NOT NULL default '0',
- rid int(10) unsigned NOT NULL default '0',
- PRIMARY KEY (uid, rid)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'variable'
---
-
-CREATE TABLE variable (
- name varchar(48) NOT NULL default '',
- value longtext NOT NULL,
- PRIMARY KEY (name)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'vocabulary'
---
-
-CREATE TABLE vocabulary (
- vid int(10) unsigned NOT NULL auto_increment,
- name varchar(255) NOT NULL default '',
- description longtext,
- help varchar(255) NOT NULL default '',
- relations tinyint(3) unsigned NOT NULL default '0',
- hierarchy tinyint(3) unsigned NOT NULL default '0',
- multiple tinyint(3) unsigned NOT NULL default '0',
- required tinyint(3) unsigned NOT NULL default '0',
- tags tinyint(3) unsigned NOT NULL default '0',
- module varchar(255) NOT NULL default '',
- weight tinyint(4) NOT NULL default '0',
- PRIMARY KEY (vid)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'vocabulary_node_types'
---
-
-CREATE TABLE vocabulary_node_types (
- vid int(10) unsigned NOT NULL DEFAULT '0',
- type varchar(32) NOT NULL DEFAULT '',
- PRIMARY KEY (vid, type)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Table structure for table 'watchdog'
---
-
-CREATE TABLE watchdog (
- wid int(5) NOT NULL auto_increment,
- uid int(10) NOT NULL default '0',
- type varchar(16) NOT NULL default '',
- message longtext NOT NULL,
- severity tinyint(3) unsigned NOT NULL default '0',
- link varchar(255) NOT NULL default '',
- location varchar(128) NOT NULL default '',
- referer varchar(128) NOT NULL default '',
- hostname varchar(128) NOT NULL default '',
- timestamp int(11) NOT NULL default '0',
- PRIMARY KEY (wid)
-)
-DEFAULT CHARACTER SET utf8;
-
---
--- Insert some default values
---
-
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/block/block.module', 'block', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/comment/comment.module', 'comment', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/filter/filter.module', 'filter', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/help/help.module', 'help', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/menu/menu.module', 'menu', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/node/node.module', 'node', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/page/page.module', 'page', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/story/story.module', 'story', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/system/system.module', 'system', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/taxonomy/taxonomy.module', 'taxonomy', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/user/user.module', 'user', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/watchdog/watchdog.module', 'watchdog', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('themes/engines/phptemplate/phptemplate.engine', 'phptemplate', 'theme_engine', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('themes/bluemarine/page.tpl.php', 'bluemarine', 'theme', 'themes/engines/phptemplate/phptemplate.engine', 1, 0, 0, 0);
-INSERT INTO users (uid, name, mail) VALUES ('0', '', '');
-
-INSERT INTO role (rid, name) VALUES (1, 'anonymous user');
-INSERT INTO role (rid, name) VALUES (2, 'authenticated user');
-
-INSERT INTO permission VALUES (1,'access content',0);
-INSERT INTO permission VALUES (2,'access comments, access content, post comments, post comments without approval',0);
-
-INSERT INTO variable (name, value) VALUES ('theme_default', 's:10:"bluemarine";');
-
-INSERT INTO blocks (module, delta, theme, status, pages) VALUES ('user', '0', 'bluemarine', '1', '');
-INSERT INTO blocks (module, delta, theme, status, pages) VALUES ('user', '1', 'bluemarine', '1', '');
-
-INSERT INTO sequences (name, id) VALUES ('menu_mid', 2);
-
-INSERT INTO node_access VALUES (0, 0, 'all', 1, 0, 0);
-
-INSERT INTO filter_formats VALUES (1,'Filtered HTML',',1,2,',1);
-INSERT INTO filter_formats VALUES (2,'PHP code','',0);
-INSERT INTO filter_formats VALUES (3,'Full HTML','',1);
-INSERT INTO filters VALUES (1,'filter',0,0);
-INSERT INTO filters VALUES (1,'filter',2,1);
-INSERT INTO filters VALUES (2,'filter',1,0);
-INSERT INTO filters VALUES (3,'filter',2,0);
-INSERT INTO variable (name,value) VALUES ('filter_html_1','i:1;');
-
-INSERT INTO locales_meta (locale, name, enabled, isdefault) VALUES ('en', 'English', '1', '1');
-
-INSERT INTO variable (name, value) VALUES ('node_options_forum', 'a:1:{i:0;s:6:"status";}');
-
-INSERT INTO menu VALUES (2, 0, '', 'Primary links', '', 0, 115);
-INSERT INTO variable VALUES ('menu_primary_menu', 'i:2;');
-INSERT INTO variable VALUES ('menu_secondary_menu', 'i:2;');
-
diff --git a/database/database.pgsql b/database/database.pgsql
deleted file mode 100644
index 20e51a9..0000000
--- a/database/database.pgsql
+++ /dev/null
@@ -1,920 +0,0 @@
--- $Id$
-
--- Do not show NOTICE: messages, it's hard to spot errors.
-set client_min_messages = 'warning';
-
---
--- Table structure for access
---
-
-CREATE TABLE access (
- aid SERIAL,
- mask varchar(255) NOT NULL default '',
- type varchar(255) NOT NULL default '',
- status smallint NOT NULL default '0',
- PRIMARY KEY (aid)
-);
-
---
--- Table structure for accesslog
---
-
-CREATE TABLE accesslog (
- aid SERIAL,
- sid varchar(32) NOT NULL default '',
- title varchar(255) default NULL,
- path text default NULL,
- url text default NULL,
- hostname varchar(128) default NULL,
- uid integer default '0',
- timer integer NOT NULL default '0',
- timestamp integer NOT NULL default '0',
- PRIMARY KEY (aid)
-);
-CREATE INDEX accesslog_timestamp_idx ON accesslog (timestamp);
-
---
--- Table structure for table 'aggregator_category'
---
-
-CREATE TABLE aggregator_category (
- cid serial,
- title varchar(255) NOT NULL default '',
- description text,
- block smallint NOT NULL default '0',
- PRIMARY KEY (cid),
- UNIQUE (title)
-);
-
---
--- Table structure for table 'aggregator_category_feed'
---
-
-CREATE TABLE aggregator_category_feed (
- fid integer NOT NULL default '0',
- cid integer NOT NULL default '0',
- PRIMARY KEY (fid,cid)
-);
-
---
--- Table structure for table 'aggregator_category_item'
---
-
-CREATE TABLE aggregator_category_item (
- iid integer NOT NULL default '0',
- cid integer NOT NULL default '0',
- PRIMARY KEY (iid,cid)
-);
-
---
--- Table structure for table 'aggregator_feed'
---
-
-CREATE TABLE aggregator_feed (
- fid serial,
- title varchar(255) NOT NULL default '',
- url varchar(255) NOT NULL default '',
- refresh integer NOT NULL default '0',
- checked integer NOT NULL default '0',
- link varchar(255) NOT NULL default '',
- description text,
- image text,
- etag varchar(255) NOT NULL default '',
- modified integer NOT NULL default '0',
- block smallint NOT NULL default '0',
- PRIMARY KEY (fid),
- UNIQUE (url),
- UNIQUE (title)
-);
-
---
--- Table structure for table 'aggregator_item'
---
-
-CREATE TABLE aggregator_item (
- iid SERIAL,
- fid integer NOT NULL default '0',
- title varchar(255) NOT NULL default '',
- link varchar(255) NOT NULL default '',
- author varchar(255) NOT NULL default '',
- description text,
- timestamp integer default NULL,
- PRIMARY KEY (iid)
-);
-
---
--- Table structure for authmap
---
-
-CREATE TABLE authmap (
- aid SERIAL,
- uid integer NOT NULL default '0',
- authname varchar(128) NOT NULL default '',
- module varchar(128) NOT NULL default '',
- PRIMARY KEY (aid),
- UNIQUE (authname)
-);
-
---
--- Table structure for blocks
---
-
-CREATE TABLE blocks (
- module varchar(64) NOT NULL default '',
- delta varchar(32) NOT NULL default '0',
- theme varchar(255) NOT NULL default '',
- status smallint NOT NULL default '0',
- weight smallint NOT NULL default '0',
- region varchar(64) DEFAULT 'left' NOT NULL,
- custom smallint NOT NULL default '0',
- throttle smallint NOT NULL default '0',
- visibility smallint NOT NULL default '0',
- pages text NOT NULL default ''
-);
-
---
--- Table structure for book
---
-
-CREATE TABLE book (
- vid integer NOT NULL default '0',
- nid integer NOT NULL default '0',
- parent integer NOT NULL default '0',
- weight smallint NOT NULL default '0',
- PRIMARY KEY (vid)
-);
-CREATE INDEX book_nid_idx ON book(nid);
-CREATE INDEX book_parent_idx ON book(parent);
-
---
--- Table structure for boxes
---
-
-CREATE TABLE boxes (
- bid SERIAL,
- title varchar(64) NOT NULL default '',
- body text default '',
- info varchar(128) NOT NULL default '',
- format smallint NOT NULL default '0',
- PRIMARY KEY (bid),
- UNIQUE (info)
-);
-
---
--- Table structure for cache
---
-
-CREATE TABLE cache (
- cid varchar(255) NOT NULL default '',
- data bytea default '',
- expire integer NOT NULL default '0',
- created integer NOT NULL default '0',
- headers text default '',
- PRIMARY KEY (cid)
-);
-CREATE INDEX cache_expire_idx ON cache(expire);
-
---
--- Table structure for comments
---
-
-CREATE TABLE comments (
- cid SERIAL,
- pid integer NOT NULL default '0',
- nid integer NOT NULL default '0',
- uid integer NOT NULL default '0',
- subject varchar(64) NOT NULL default '',
- comment text NOT NULL default '',
- hostname varchar(128) NOT NULL default '',
- timestamp integer NOT NULL default '0',
- score integer NOT NULL default '0',
- status smallint NOT NULL default '0',
- format smallint NOT NULL default '0',
- thread varchar(255) default '',
- users text default '',
- name varchar(60) default NULL,
- mail varchar(64) default NULL,
- homepage varchar(255) default NULL,
- PRIMARY KEY (cid)
-);
-CREATE INDEX comments_nid_idx ON comments(nid);
-
---
--- Table structre for table 'contact'
---
-
-CREATE TABLE contact (
- cid SERIAL,
- category varchar(255) NOT NULL default '',
- recipients text NOT NULL default '',
- reply text NOT NULL default '',
- weight smallint NOT NULL default '0',
- selected smallint NOT NULL default '0',
- PRIMARY KEY (cid),
- UNIQUE (category)
-);
-
---
--- Table structre for table 'node_comment_statistics'
---
-
-CREATE TABLE node_comment_statistics (
- nid integer NOT NULL,
- last_comment_timestamp integer NOT NULL default '0',
- last_comment_name varchar(60) default NULL,
- last_comment_uid integer NOT NULL default '0',
- comment_count integer NOT NULL default '0',
- PRIMARY KEY (nid)
-);
-CREATE INDEX node_comment_statistics_last_comment_timestamp_idx ON node_comment_statistics(last_comment_timestamp);
-
---
--- Table structure for directory
---
-
-CREATE TABLE client (
- cid SERIAL,
- link varchar(255) NOT NULL default '',
- name varchar(128) NOT NULL default '',
- mail varchar(128) NOT NULL default '',
- slogan text NOT NULL default '',
- mission text NOT NULL default '',
- users integer NOT NULL default '0',
- nodes integer NOT NULL default '0',
- version varchar(35) NOT NULL default'',
- created integer NOT NULL default '0',
- changed integer NOT NULL default '0',
- PRIMARY KEY (cid)
-);
-
---
--- Table structure for table 'client_system'
---
-
-CREATE TABLE client_system (
- cid integer NOT NULL,
- name varchar(255) NOT NULL default '',
- type varchar(255) NOT NULL default '',
- PRIMARY KEY (cid,name)
-);
-
---
--- Table structure for table 'files'
---
-
-CREATE TABLE files (
- fid SERIAL,
- nid integer NOT NULL default 0,
- filename varchar(255) NOT NULL default '',
- filepath varchar(255) NOT NULL default '',
- filemime varchar(255) NOT NULL default '',
- filesize integer NOT NULL default 0,
- PRIMARY KEY (fid)
-);
-
---
--- Table structure for table 'file_revisions'
---
-
-CREATE TABLE file_revisions (
- fid integer NOT NULL default 0,
- vid integer NOT NULL default 0,
- description varchar(255) NOT NULL default '',
- list smallint NOT NULL default 0,
- PRIMARY KEY (fid, vid)
-);
-
---
--- Table structure for table 'filter_formats'
---
-
-CREATE TABLE filter_formats (
- format SERIAL,
- name varchar(255) NOT NULL default '',
- roles varchar(255) NOT NULL default '',
- cache smallint NOT NULL default '0',
- PRIMARY KEY (format),
- UNIQUE (name)
-);
-
---
--- Table structure for table 'filters'
---
-
-CREATE TABLE filters (
- format integer NOT NULL DEFAULT '0',
- module varchar(64) NOT NULL DEFAULT '',
- delta smallint NOT NULL DEFAULT 0,
- weight smallint DEFAULT '0' NOT NULL
-);
-CREATE INDEX filters_weight_idx ON filters(weight);
-
---
--- Table structure for table 'flood'
---
-
-CREATE TABLE flood (
- event varchar(64) NOT NULL default '',
- hostname varchar(128) NOT NULL default '',
- timestamp integer NOT NULL default '0'
-);
-
---
--- Table structure for table 'forum'
---
-
-CREATE TABLE forum (
- nid integer NOT NULL default '0',
- vid integer NOT NULL default '0',
- tid integer NOT NULL default '0',
- PRIMARY KEY (vid)
-);
-CREATE INDEX forum_tid_idx ON forum(tid);
-CREATE INDEX forum_nid_idx ON forum(nid);
-
---
--- Table structure for history
---
-
-CREATE TABLE history (
- uid integer NOT NULL default '0',
- nid integer NOT NULL default '0',
- timestamp integer NOT NULL default '0',
- PRIMARY KEY (uid,nid)
-);
-
---
--- Table structure for locales_meta
---
-
-CREATE TABLE locales_meta (
- locale varchar(12) NOT NULL default '',
- name varchar(64) NOT NULL default '',
- enabled int4 NOT NULL default '0',
- isdefault int4 NOT NULL default '0',
- plurals int4 NOT NULL default '0',
- formula varchar(128) NOT NULL default '',
- PRIMARY KEY (locale)
-);
-
---
--- Table structure for locales_source
---
-
-
-CREATE TABLE locales_source (
- lid SERIAL,
- location varchar(255) NOT NULL default '',
- source text NOT NULL,
- PRIMARY KEY (lid)
-);
-
---
--- Table structure for locales_target
---
-
-CREATE TABLE locales_target (
- lid int4 NOT NULL default '0',
- translation text DEFAULT '' NOT NULL,
- locale varchar(12) NOT NULL default '',
- plid int4 NOT NULL default '0',
- plural int4 NOT NULL default '0'
-);
-CREATE INDEX locales_target_lid_idx ON locales_target(lid);
-CREATE INDEX locales_target_locale_idx ON locales_target(locale);
-CREATE INDEX locales_target_plid_idx ON locales_target(plid);
-CREATE INDEX locales_target_plural_idx ON locales_target(plural);
-
---
--- Table structure for table 'menu'
---
-
-
-CREATE SEQUENCE menu_mid_seq START 2;
-CREATE TABLE menu (
- mid integer NOT NULL DEFAULT nextval('menu_mid_seq'),
- pid integer NOT NULL default '0',
- path varchar(255) NOT NULL default '',
- title varchar(255) NOT NULL default '',
- description varchar(255) NOT NULL default '',
- weight smallint NOT NULL default '0',
- type smallint NOT NULL default '0',
- PRIMARY KEY (mid)
-);
-
---
--- Table structure for node
---
-
-CREATE TABLE node (
- nid SERIAL,
- vid integer NOT NULL default '0',
- type varchar(32) NOT NULL default '',
- title varchar(128) NOT NULL default '',
- uid integer NOT NULL default '0',
- status integer NOT NULL default '1',
- created integer NOT NULL default '0',
- changed integer NOT NULL default '0',
- comment integer NOT NULL default '0',
- promote integer NOT NULL default '0',
- moderate integer NOT NULL default '0',
- sticky integer NOT NULL default '0',
- PRIMARY KEY (nid, vid)
-);
-CREATE INDEX node_nid_idx ON node(nid);
-CREATE INDEX node_type_idx ON node(type);
-CREATE INDEX node_title_type_idx ON node(title,type);
-CREATE INDEX node_status_idx ON node(status);
-CREATE INDEX node_uid_idx ON node(uid);
-CREATE UNIQUE INDEX node_vid_idx ON node(vid);
-CREATE INDEX node_moderate_idx ON node (moderate);
-CREATE INDEX node_promote_status_idx ON node (promote, status);
-CREATE INDEX node_created_idx ON node(created);
-CREATE INDEX node_changed_idx ON node(changed);
-CREATE INDEX node_status_type_nid_idx ON node(status,type,nid);
-
---
--- Table structure for table `node_access`
---
-
-CREATE TABLE node_access (
- nid SERIAL,
- gid integer NOT NULL default '0',
- realm varchar(255) NOT NULL default '',
- grant_view smallint NOT NULL default '0',
- grant_update smallint NOT NULL default '0',
- grant_delete smallint NOT NULL default '0',
- PRIMARY KEY (nid,gid,realm)
-);
-
---
--- Table structure for table 'node_revisions'
---
-
-CREATE TABLE node_revisions (
- nid integer NOT NULL default '0',
- vid integer NOT NULL default '0',
- uid integer NOT NULL default '0',
- title varchar(128) NOT NULL default '',
- body text NOT NULL default '',
- teaser text NOT NULL default '',
- log text NOT NULL default '',
- timestamp integer NOT NULL default '0',
- format int NOT NULL default '0',
- PRIMARY KEY (vid)
-);
-CREATE INDEX node_revisions_nid_idx ON node_revisions(nid);
-CREATE INDEX node_revisions_uid_idx ON node_revisions(uid);
-CREATE SEQUENCE node_revisions_vid_seq INCREMENT 1 START 1;
-
---
--- Table structure for table 'url_alias'
---
-
-CREATE TABLE profile_fields (
- fid serial,
- title varchar(255) default NULL,
- name varchar(128) default NULL,
- explanation TEXT default NULL,
- category varchar(255) default NULL,
- page varchar(255) default NULL,
- type varchar(128) default NULL,
- weight smallint DEFAULT '0' NOT NULL,
- required smallint DEFAULT '0' NOT NULL,
- register smallint DEFAULT '0' NOT NULL,
- visibility smallint DEFAULT '0' NOT NULL,
- autocomplete smallint DEFAULT '0' NOT NULL,
- options text,
- UNIQUE (name),
- PRIMARY KEY (fid)
-);
-CREATE INDEX profile_fields_category_idx ON profile_fields (category);
-
---
--- Table structure for table 'profile_values'
---
-
-CREATE TABLE profile_values (
- fid integer default '0',
- uid integer default '0',
- value text
-);
-CREATE INDEX profile_values_uid ON profile_values (uid);
-CREATE INDEX profile_values_fid ON profile_values (fid);
-
-CREATE TABLE url_alias (
- pid serial,
- src varchar(128) NOT NULL default '',
- dst varchar(128) NOT NULL default '',
- PRIMARY KEY (pid)
-);
-CREATE UNIQUE INDEX url_alias_dst_idx ON url_alias(dst);
-CREATE INDEX url_alias_src_idx ON url_alias(src);
-
---
--- Table structure for permission
---
-
-CREATE TABLE permission (
- rid integer NOT NULL default '0',
- perm text default '',
- tid integer NOT NULL default '0'
-);
-CREATE INDEX permission_rid_idx ON permission(rid);
-
---
--- Table structure for poll
---
-
-CREATE TABLE poll (
- nid integer NOT NULL default '0',
- runtime integer NOT NULL default '0',
- active integer NOT NULL default '0',
- PRIMARY KEY (nid)
-);
-
---
--- Table structure for poll_votes
---
-
-CREATE TABLE poll_votes (
- nid int NOT NULL,
- uid int NOT NULL default 0,
- chorder int NOT NULL default -1,
- hostname varchar(128) NOT NULL default ''
-);
-CREATE INDEX poll_votes_nid_idx ON poll_votes (nid);
-CREATE INDEX poll_votes_uid_idx ON poll_votes (uid);
-CREATE INDEX poll_votes_hostname_idx ON poll_votes (hostname);
-
---
--- Table structure for poll_choices
---
-
-CREATE TABLE poll_choices (
- chid SERIAL,
- nid integer NOT NULL default '0',
- chtext varchar(128) NOT NULL default '',
- chvotes integer NOT NULL default '0',
- chorder integer NOT NULL default '0',
- PRIMARY KEY (chid)
-);
-CREATE INDEX poll_choices_nid_idx ON poll_choices(nid);
-
---
--- Table structure for role
---
-
-CREATE TABLE role (
- rid SERIAL,
- name varchar(32) NOT NULL default '',
- PRIMARY KEY (rid),
- UNIQUE (name)
-);
-
---
--- Table structure for table 'blocks_roles'
---
-
-CREATE TABLE blocks_roles (
- module varchar(64) NOT NULL,
- delta varchar(32) NOT NULL,
- rid integer NOT NULL,
- PRIMARY KEY (module, delta, rid)
-);
-
---
--- Table structure for table 'search_dataset'
---
-CREATE TABLE search_dataset (
- sid integer NOT NULL default '0',
- type varchar(16) default NULL,
- data text NOT NULL default ''
-);
-CREATE INDEX search_dataset_sid_type_idx ON search_dataset(sid, type);
-
---
--- Table structure for search_index
---
-
-CREATE TABLE search_index (
- word varchar(50) NOT NULL default '',
- sid integer NOT NULL default '0',
- type varchar(16) default NULL,
- fromsid integer NOT NULL default '0',
- fromtype varchar(16) default NULL,
- score float default NULL
-);
-CREATE INDEX search_index_sid_type_idx ON search_index(sid, type);
-CREATE INDEX search_index_fromsid_fromtype_idx ON search_index(fromsid, fromtype);
-CREATE INDEX search_index_word_idx ON search_index(word);
-
---
--- Table structures for search_total
---
-
-CREATE TABLE search_total (
- word varchar(50) NOT NULL default '',
- count float default NULL,
- PRIMARY KEY(word)
-);
-
---
--- Table structure for sessions
---
-
-CREATE TABLE sessions (
- uid integer not null,
- sid varchar(32) NOT NULL default '',
- hostname varchar(128) NOT NULL default '',
- timestamp integer NOT NULL default '0',
- cache integer NOT NULL default '0',
- session text,
- PRIMARY KEY (sid)
-);
-CREATE INDEX sessions_uid_idx ON sessions(uid);
-CREATE INDEX sessions_timestamp_idx ON sessions(timestamp);
-
---
--- Table structure for sequences
--- This is only used under MySQL, co commented out
---
---
--- CREATE TABLE sequences (
--- name varchar(255) NOT NULL,
--- id integer NOT NULL,
--- PRIMARY KEY (name)
--- );
-
---
--- Table structure for table 'node_counter'
---
-
-CREATE TABLE node_counter (
- nid integer NOT NULL default '0',
- totalcount integer NOT NULL default '0',
- daycount integer NOT NULL default '0',
- timestamp integer NOT NULL default '0',
- PRIMARY KEY (nid)
-);
-CREATE INDEX node_counter_totalcount_idx ON node_counter(totalcount);
-CREATE INDEX node_counter_daycount_idx ON node_counter(daycount);
-CREATE INDEX node_counter_timestamp_idx ON node_counter(timestamp);
-
---
--- Table structure for system
---
-
-CREATE TABLE system (
- filename varchar(255) NOT NULL default '',
- name varchar(255) NOT NULL default '',
- type varchar(255) NOT NULL default '',
- description varchar(255) NOT NULL default '',
- status integer NOT NULL default '0',
- throttle smallint NOT NULL default '0',
- bootstrap integer NOT NULL default '0',
- schema_version smallint NOT NULL default -1,
- weight smallint NOT NULL default 0,
- PRIMARY KEY (filename)
-);
-CREATE INDEX system_weight_idx ON system(weight);
-
---
--- Table structure for term_data
---
-
-CREATE TABLE term_data (
- tid SERIAL,
- vid integer NOT NULL default '0',
- name varchar(255) NOT NULL default '',
- description text default '',
- weight smallint NOT NULL default '0',
- PRIMARY KEY (tid)
-);
-CREATE INDEX term_data_vid_idx ON term_data(vid);
-
---
--- Table structure for term_hierarchy
---
-
-CREATE TABLE term_hierarchy (
- tid integer NOT NULL default '0',
- parent integer NOT NULL default '0',
- PRIMARY KEY (tid, parent)
-);
-CREATE INDEX term_hierarchy_tid_idx ON term_hierarchy(tid);
-CREATE INDEX term_hierarchy_parent_idx ON term_hierarchy(parent);
-
---
--- Table structure for term_node
---
-
-CREATE TABLE term_node (
- nid integer NOT NULL default '0',
- tid integer NOT NULL default '0',
- PRIMARY KEY (tid,nid)
-);
-CREATE INDEX term_node_nid_idx ON term_node(nid);
-CREATE INDEX term_node_tid_idx ON term_node(tid);
-
---
--- Table structure for term_relation
---
-
-CREATE TABLE term_relation (
- tid1 integer NOT NULL default '0',
- tid2 integer NOT NULL default '0'
-);
-CREATE INDEX term_relation_tid1_idx ON term_relation(tid1);
-CREATE INDEX term_relation_tid2_idx ON term_relation(tid2);
-
---
--- Table structure for term_synonym
---
-
-CREATE TABLE term_synonym (
- tid integer NOT NULL default '0',
- name varchar(255) NOT NULL default ''
-);
-CREATE INDEX term_synonym_tid_idx ON term_synonym(tid);
-CREATE INDEX term_synonym_name_idx ON term_synonym(name);
-
---
--- Table structure for users
---
-
-CREATE TABLE users (
- uid integer NOT NULL default '0',
- name varchar(60) NOT NULL default '',
- pass varchar(32) NOT NULL default '',
- mail varchar(64) default '',
- mode smallint NOT NULL default '0',
- sort smallint default '0',
- threshold smallint default '0',
- theme varchar(255) NOT NULL default '',
- signature varchar(255) NOT NULL default '',
- created integer NOT NULL default '0',
- access integer NOT NULL default '0',
- login integer NOT NULL default '0',
- status smallint NOT NULL default '0',
- timezone varchar(8) default NULL,
- language varchar(12) NOT NULL default '',
- picture varchar(255) NOT NULL DEFAULT '',
- init varchar(64) default '',
- data text default '',
- PRIMARY KEY (uid),
- UNIQUE (name)
-);
-CREATE INDEX users_access_idx ON users(access);
-
-CREATE SEQUENCE users_uid_seq INCREMENT 1 START 1;
-
---
--- Table structure for users_roles
---
-
-CREATE TABLE users_roles (
- uid integer NOT NULL default '0',
- rid integer NOT NULL default '0',
- PRIMARY KEY (uid, rid)
-);
-
---
--- Table structure for variable
---
-
-CREATE TABLE variable (
- name varchar(48) NOT NULL default '',
- value text NOT NULL default '',
- PRIMARY KEY (name)
-);
-
---
--- Table structure for vocabulary
---
-
-CREATE TABLE vocabulary (
- vid SERIAL,
- name varchar(255) NOT NULL default '',
- description text default '',
- help varchar(255) NOT NULL default '',
- relations smallint NOT NULL default '0',
- hierarchy smallint NOT NULL default '0',
- multiple smallint NOT NULL default '0',
- required smallint NOT NULL default '0',
- tags smallint NOT NULL default '0',
- module varchar(255) NOT NULL default '',
- weight smallint NOT NULL default '0',
- PRIMARY KEY (vid)
-);
-
---
--- Table structure for vocabulary_node_types
---
-
-CREATE TABLE vocabulary_node_types (
- vid integer NOT NULL default '0',
- type varchar(32) NOT NULL default '',
- PRIMARY KEY (vid, type)
-);
-
---
--- Table structure for watchdog
---
-
-CREATE TABLE watchdog (
- wid SERIAL,
- uid integer NOT NULL default '0',
- type varchar(16) NOT NULL default '',
- message text NOT NULL default '',
- severity smallint NOT NULL default '0',
- link text NOT NULL default '',
- location text NOT NULL default '',
- referer text NOT NULL default '',
- hostname varchar(128) NOT NULL default '',
- timestamp integer NOT NULL default '0',
- PRIMARY KEY (wid)
-);
-
---
--- Insert some default values
---
-
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/block/block.module', 'block', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/comment/comment.module', 'comment', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/filter/filter.module', 'filter', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/help/help.module', 'help', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/menu/menu.module', 'menu', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/node/node.module', 'node', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/page/page.module', 'page', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/story/story.module', 'story', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/system/system.module', 'system', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/taxonomy/taxonomy.module', 'taxonomy', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/user/user.module', 'user', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/watchdog/watchdog.module', 'watchdog', 'module', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('themes/engines/phptemplate/phptemplate.engine', 'phptemplate', 'theme_engine', '', 1, 0, 0, 0);
-INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('themes/bluemarine/page.tpl.php', 'bluemarine', 'theme', 'themes/engines/phptemplate/phptemplate.engine', 1, 0, 0, 0);
-
-INSERT INTO users(uid,name,mail) VALUES(0,'','');
-
-INSERT INTO role (name) VALUES ('anonymous user');
-INSERT INTO role (name) VALUES ('authenticated user');
-
-INSERT INTO permission VALUES (1,'access content',0);
-INSERT INTO permission VALUES (2,'access comments, access content, post comments, post comments without approval',0);
-
-INSERT INTO variable(name,value) VALUES('theme_default', 's:10:"bluemarine";');
-
-INSERT INTO blocks(module,delta,theme,status) VALUES('user', 0, 'bluemarine', 1);
-INSERT INTO blocks(module,delta,theme,status) VALUES('user', 1, 'bluemarine', 1);
-
-INSERT INTO node_access VALUES (0, 0, 'all', 1, 0, 0);
-
-INSERT INTO filter_formats (name, roles, cache) VALUES ('Filtered HTML',',1,2,',1);
-INSERT INTO filter_formats (name, roles, cache) VALUES ('PHP code','',0);
-INSERT INTO filter_formats (name, roles, cache) VALUES ('Full HTML','',1);
-INSERT INTO filters VALUES (1,'filter',0,0);
-INSERT INTO filters VALUES (1,'filter',2,1);
-INSERT INTO filters VALUES (2,'filter',1,0);
-INSERT INTO filters VALUES (3,'filter',2,0);
-INSERT INTO variable (name,value) VALUES ('filter_html_1','i:1;');
-
-INSERT INTO locales_meta (locale, name, enabled, isdefault) VALUES ('en', 'English', '1', '1');
-
-INSERT INTO variable (name, value) VALUES ('node_options_forum', 'a:1:{i:0;s:6:"status";}');
-
-INSERT INTO menu(pid, path, title, description, weight, type) VALUES (0, '', 'Primary links', '', 0, 115);
-INSERT INTO variable VALUES ('menu_primary_menu', 'i:2;');
-INSERT INTO variable VALUES ('menu_secondary_menu', 'i:2;');
-
----
---- Functions
----
-
---- Always installed in 'public' as prefix isn't appended to function names
-SET search_path TO public;
-
-CREATE OR REPLACE FUNCTION "greatest"(numeric, numeric) RETURNS numeric AS '
- SELECT CASE WHEN (($1 > $2) OR ($2 IS NULL)) THEN $1 ELSE $2 END;
-' LANGUAGE 'sql';
-
-CREATE OR REPLACE FUNCTION "greatest"(numeric, numeric, numeric) RETURNS numeric AS '
- SELECT greatest($1, greatest($2, $3));
-' LANGUAGE 'sql';
-
-CREATE OR REPLACE FUNCTION "rand"() RETURNS float AS '
- SELECT random();
-' LANGUAGE 'sql';
-
-CREATE OR REPLACE FUNCTION "concat"(text, text) RETURNS text AS '
- SELECT $1 || $2;
-' LANGUAGE 'sql';
-
-CREATE OR REPLACE FUNCTION "if"(boolean, text, text) RETURNS text AS '
- SELECT CASE WHEN $1 THEN $2 ELSE $3 END;
-' LANGUAGE 'sql';
-
-CREATE OR REPLACE FUNCTION "if"(boolean, integer, integer) RETURNS integer AS '
- SELECT CASE WHEN $1 THEN $2 ELSE $3 END;
-' LANGUAGE 'sql';
-
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index ba7ab0a..1c68b13 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -151,9 +151,9 @@ function drupal_unset_globals() {
* Loads the configuration and sets the base URL correctly.
*/
function conf_init() {
- global $db_url, $db_prefix, $base_url, $base_path, $base_root, $conf;
+ global $db_url, $db_prefix, $base_url, $base_path, $base_root, $conf, $installed_profile;
$conf = array();
- require_once './'. conf_path() .'/settings.php';
+ include_once './'. conf_path() .'/settings.php';
if (isset($base_url)) {
// Parse fixed base URL from settings.php.
@@ -565,14 +565,21 @@ function drupal_set_message($message = NULL, $type = 'status') {
/**
* Return all messages that have been set.
*
- * As a side effect, this function clears the message queue.
+ * @param $type
+ * (optional) Only return messages of this type.
*/
-function drupal_get_messages() {
+function drupal_get_messages($type = NULL) {
if ($messages = drupal_set_message()) {
- unset($_SESSION['messages']);
+ if ($type) {
+ unset($_SESSION['messages'][$type]);
+ return array($type => $messages[$type]);
+ }
+ else {
+ unset($_SESSION['messages']);
+ return $messages;
+ }
}
-
- return $messages;
+ return array();
}
/**
diff --git a/includes/database.mysql.inc b/includes/database.mysql.inc
index 18b2ca7..0326bd5 100644
--- a/includes/database.mysql.inc
+++ b/includes/database.mysql.inc
@@ -53,7 +53,8 @@ function db_connect($url) {
if (!$connection) {
drupal_maintenance_theme();
drupal_set_title('Unable to connect to database server');
- print theme('maintenance_page', '<p>This either means that the username and password information in your <code>settings.php</code> file is incorrect or we can\'t contact the MySQL database server. This could mean your hosting provider\'s database server is down.</p>
+ print theme('maintenance_page', '<p>If you still have to install Drupal, proceed to the <a href="'. base_path() .'install.php">installation page</a>.</p>
+<p>If you have already finished installed Drupal, this either means that the username and password information in your <code>settings.php</code> file is incorrect or that we can\'t connect to the MySQL database server. This could mean your hosting provider\'s database server is down.</p>
<p>The MySQL error was: '. theme('placeholder', mysql_error()) .'.</p>
<p>Currently, the username is '. theme('placeholder', $url['user']) .' and the database server is '. theme('placeholder', $url['host']) .'.</p>
<ul>
diff --git a/includes/database.mysqli.inc b/includes/database.mysqli.inc
index 0bbe3fe..a843833 100644
--- a/includes/database.mysqli.inc
+++ b/includes/database.mysqli.inc
@@ -45,7 +45,8 @@ function db_connect($url) {
if (mysqli_connect_errno() >= 2000 || mysqli_connect_errno() == 1045) {
drupal_maintenance_theme();
drupal_set_title('Unable to connect to database server');
- print theme('maintenance_page', '<p>This either means that the username and password information in your <code>settings.php</code> file is incorrect or we can\'t contact the MySQL database server through the mysqli libraries. This could also mean your hosting provider\'s database server is down.</p>
+ print theme('maintenance_page', '<p>If you still have to install Drupal, proceed to the <a href="'. base_path() .'install.php">installation page</a>.</p>
+<p>If you have already finished installed Drupal, this either means that the username and password information in your <code>settings.php</code> file is incorrect or that we can\'t connect to the MySQL database server. This could mean your hosting provider\'s database server is down.</p>
<p>The MySQL error was: '. theme('placeholder', mysqli_error($connection)) .'.</p>
<p>Currently, the username is '. theme('placeholder', $url['user']) .' and the database server is '. theme('placeholder', $url['host']) .'.</p>
<ul>
diff --git a/includes/database.pgsql.inc b/includes/database.pgsql.inc
index cefc82a..bb7ffd1 100644
--- a/includes/database.pgsql.inc
+++ b/includes/database.pgsql.inc
@@ -51,7 +51,8 @@ function db_connect($url) {
if (!$connection) {
drupal_maintenance_theme();
drupal_set_title('Unable to connect to database');
- print theme('maintenance_page', '<p>This either means that the database information in your <code>settings.php</code> file is incorrect or we can\'t contact the PostgreSQL database server. This could mean your hosting provider\'s database server is down.</p>
+ print theme('maintenance_page', '<p>If you still have to install Drupal, proceed to the <a href="'. base_path() .'install.php">installation page</a>.</p>
+<p>If you have already finished installed Drupal, this either means that the username and password information in your <code>settings.php</code> file is incorrect or that we can\'t connect to the PostgreSQL database server. This could mean your hosting provider\'s database server is down.</p>
<p>The PostgreSQL error was: '. theme('placeholder', decode_entities($php_errormsg)) .'</p>
<p>Currently, the database is '. theme('placeholder', substr($url['path'], 1)) .', the username is '. theme('placeholder', $url['user']) .', and the database server is '. theme('placeholder', $url['host']) .'.</p>
<ul>
diff --git a/includes/install.inc b/includes/install.inc
index cff01f7..bef15c6 100644
--- a/includes/install.inc
+++ b/includes/install.inc
@@ -4,15 +4,29 @@
define('SCHEMA_UNINSTALLED', -1);
define('SCHEMA_INSTALLED', 0);
+define('DRUPAL_MINIMUM_PHP', '4.3.3');
+define('DRUPAL_MINIMUM_MEMORY', '8M');
+define('DRUPAL_MINIMUM_MYSQL', '3.23.17'); // If using MySQL
+define('DRUPAL_MINIMUM_PGSQL', '7.3'); // If using PostgreSQL
+define('DRUPAL_MINIMUM_APACHE', '1.3'); // If using Apache
-// The system module (Drupal core) is currently a special case
-include_once './database/updates.inc';
+define('FILE_EXIST', 1);
+define('FILE_READABLE', 2);
+define('FILE_WRITABLE', 4);
+define('FILE_EXECUTABLE', 8);
+define('FILE_NOT_EXIST', 16);
+define('FILE_NOT_READABLE', 32);
+define('FILE_NOT_WRITABLE', 64);
+define('FILE_NOT_EXECUTABLE', 128);
-// Include install files for each module
-foreach (module_list() as $module) {
- $install_file = './'. drupal_get_path('module', $module) .'/'. $module .'.install';
- if (is_file($install_file)) {
- include_once $install_file;
+// Initialize the update system if necessary
+if (!$install) {
+ // Include install files for each installed module.
+ foreach (module_list() as $module) {
+ $install_file = './'. drupal_get_path('module', $module) .'/'. $module .'.install';
+ if (is_file($install_file)) {
+ include_once $install_file;
+ }
}
}
@@ -79,3 +93,410 @@ function drupal_get_installed_schema_version($module, $reset = FALSE) {
function drupal_set_installed_schema_version($module, $version) {
db_query("UPDATE {system} SET schema_version = %d WHERE name = '%s'", $version, $module);
}
+
+/**
+ * Loads the profile definition, extracting the profile's defined name.
+ *
+ * @return
+ * The name defined in the profile's _profile_details() hook.
+ */
+function drupal_install_profile_name() {
+ global $profile;
+ static $name = NULL;
+
+ if (!isset($name)) {
+ // Load profile details.
+ $function = $profile .'_profile_details';
+ if (function_exists($function)) {
+ $details = $function();
+ }
+ $name = isset($details['name']) ? $details['name'] : 'Drupal';
+ }
+
+ return $name;
+}
+
+/**
+ * Auto detect the base_url with PHP predefined variables.
+ *
+ * @param $file
+ * The name of the file calling this function so we can strip it out of
+ * the URI when generating the base_url.
+ *
+ * @return
+ * The auto-detected $base_url that should be configured in settings.php
+ */
+function drupal_detect_baseurl($file = 'install.php') {
+ global $profile;
+ $proto = $_SERVER['HTTPS'] ? 'https://' : 'http://';
+ $host = $_SERVER['SERVER_NAME'];
+ $port = ($_SERVER['SERVER_PORT'] == 80 ? '' : ':'. $_SERVER['SERVER_PORT']);
+ $uri = str_replace("?profile=$profile", '', $_SERVER['REQUEST_URI']);
+ $dir = str_replace("/$file", '', $uri);
+
+ return "$proto$host$port$dir";
+}
+
+/**
+ * Detect all databases supported by Drupal that are compiled into the current
+ * PHP installation.
+ *
+ * @return
+ * An array of database types compiled into PHP.
+ */
+function drupal_detect_database_types() {
+ $databases = array();
+
+ foreach (array('mysql', 'mysqli', 'pgsql') as $type) {
+ if (file_exists('./includes/install.'. $type .'.inc')) {
+ include_once './includes/install.'. $type .'.inc';
+ $function = $type .'_is_available';
+ if ($function()) {
+ $databases[$type] = $type;
+ }
+ }
+ }
+
+ return $databases;
+}
+
+/**
+ * Read settings.php into a buffer line by line, changing values specified in
+ * $settings array, then over-writing the old settings.php file.
+ *
+ * @param $settings
+ * An array of settings that need to be updated.
+ */
+function drupal_rewrite_settings($settings = array(), $prefix = '') {
+ $settings_file = './'. conf_path() .'/'. $prefix .'settings.php';
+
+ // Build list of setting names and insert the values into the global namespace.
+ $keys = array();
+ foreach ($settings as $setting => $data) {
+ $GLOBALS[$setting] = $data['value'];
+ $keys[] = $setting;
+ }
+
+ $buffer = NULL;
+ $first = TRUE;
+ if ($fp = @fopen($settings_file, 'r+')) {
+ // Step line by line through settings.php.
+ while (!feof($fp)) {
+ $line = fgets($fp);
+ if ($first && substr($line, 0, 5) != '<?php') {
+ $buffer = "<?php\n\n";
+ }
+ $first = FALSE;
+ // Check for constants.
+ if (substr($line, 0, 7) == 'define(') {
+ preg_match('/define\(\s*[\'"]([A-Z_-]+)[\'"]\s*,(.*?)\);/', $line, $variable);
+ if (in_array($variable[1], $keys)) {
+ $setting = $settings[$variable[1]];
+ $buffer .= str_replace($variable[2], " '". $setting['value'] ."'", $line);
+ unset($settings[$variable[1]]);
+ unset($settings[$variable[2]]);
+ }
+ else {
+ $buffer .= $line;
+ }
+ }
+ // Check for variables.
+ elseif (substr($line, 0, 1) == '$') {
+ preg_match('/\$([^ ]*) /', $line, $variable);
+ if (in_array($variable[1], $keys)) {
+ // Write new value to settings.php in the following format:
+ // $'setting' = 'value'; // 'comment'
+ $setting = $settings[$variable[1]];
+ $buffer .= '$'. $variable[1] ." = '". $setting['value'] ."';". ($setting['comment'] ? ' // '. $setting['comment'] ."\n" : "\n");
+ unset($settings[$variable[1]]);
+ }
+ else {
+ $buffer .= $line;
+ }
+ }
+ else {
+ $buffer .= $line;
+ }
+ }
+ fclose($fp);
+
+ // Add required settings that were missing from settings.php.
+ foreach ($settings as $setting => $data) {
+ if ($data['required']) {
+ $buffer .= "\$$setting = '". $data['value'] ."';\n";
+ }
+ }
+
+ $fp = fopen($settings_file, 'w');
+ if ($fp && fwrite($fp, $buffer) === FALSE) {
+ drupal_set_message(st('Failed to modify %settings, please verify the file permissions.', array('%settings' => $settings_file)), 'error');
+ }
+ }
+ else {
+ drupal_set_message(st('Failed to open %settings, please verify the file permissions.', array('%settings' => $settings_file)), 'error');
+ }
+}
+
+/**
+ * Get list of all .install files.
+ *
+ * @param $module_list
+ * An array of modules to search for their .install files.
+ */
+function drupal_get_install_files($module_list = array()) {
+ $installs = array();
+ foreach ($module_list as $module) {
+ $installs = array_merge($installs, file_scan_directory('./modules', "^$module.install$", array('.', '..', 'CVS'), 0, TRUE, 'name', 0));
+ }
+ return $installs;
+}
+
+/**
+ * Install a profile.
+ *
+ * @param profile
+ * Name of profile to install.
+ */
+function drupal_install_profile($profile) {
+ global $db_type;
+
+ include_once './includes/file.inc';
+
+ $profile_file = "./profiles/$profile.profile";
+
+ if (!isset($profile) || !file_exists($profile_file)) {
+ _install_no_profile_error();
+ }
+
+ require_once($profile_file);
+
+ // Get a list of modules required by this profile.
+ $function = $profile .'_profile_modules';
+ $module_list = $function();
+
+ // Verify that all required modules exist.
+ $modules = array();
+ foreach ($module_list as $current) {
+ $module = file_scan_directory('./modules', "^$current.module$", array('.', '..', 'CVS'), 0, TRUE, 'name', 0);
+ if (empty($module)) {
+ drupal_set_message(st('The %module module is required but was not found. Please move the file %file into the <em>modules</em> subdirectory.', array('%module' => $current, '%file' => $current .'.module')), 'error');
+ }
+ else {
+ $modules = array_merge($modules, $module);
+ }
+ }
+
+ // Get a list of all .install files.
+ $installs = drupal_get_install_files($module_list);
+
+ // Install schemas for profile and all its modules.
+ $function = $profile .'_install';
+ if (function_exists($function)) {
+ $function();
+ }
+
+ foreach ($installs as $install) {
+ require_once $install->filename;
+ module_invoke($install->name, 'install');
+ }
+
+ // Enable the modules required by the profile.
+ db_query("DELETE FROM {system} WHERE type = 'module'");
+ foreach ($modules as $module) {
+ db_query("INSERT INTO {system} (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES('%s', '%s', 'module', '', 1, 0, 0, 0)", $module->filename, $module->name);
+ }
+}
+
+/**
+ * Verify the state of the specified file.
+ *
+ * @param $file
+ * The file to check for.
+ * @param $mask
+ * An optional bitmask created from various FILE_* constants.
+ * @param $message_type
+ * The type of message to create, can be error or status. Passed on to drupal_set_message as second parameter.
+ * Set to NULL to not output any messages at all.
+ * @param $type
+ * The type of file. Can be file (default), dir, or link.
+ * @return
+ * TRUE on success or FALSE on failure. A messsage is set for the latter.
+ */
+function drupal_verify_install_file($file, $mask = NULL, $type = 'file') {
+ $return = TRUE;
+ // Check for files that shouldn't be there.
+ if (isset($mask) && ($mask & FILE_NOT_EXIST) && file_exists($file)) {
+ return FALSE;
+ }
+ // Verify that the file is the type of file it is supposed to be.
+ if (isset($type) && file_exists($file)) {
+ $check = 'is_'. $type;
+ if (!function_exists($check) || !$check($file)) {
+ $return = FALSE;
+ }
+ }
+
+ // Verify file permissions.
+ if (isset($mask)) {
+ $masks = array(FILE_EXIST, FILE_READABLE, FILE_WRITABLE, FILE_EXECUTABLE, FILE_NOT_READABLE, FILE_NOT_WRITABLE, FILE_NOT_EXECUTABLE);
+ foreach ($masks as $current_mask) {
+ if ($mask & $current_mask) {
+ switch ($current_mask) {
+ case FILE_EXIST:
+ if (!file_exists($file)) {
+ if ($type == 'dir') {
+ drupal_install_mkdir($file, $mask);
+ }
+ if (!file_exists($file)) {
+ $return = FALSE;
+ }
+ }
+ break;
+ case FILE_READABLE:
+ if (!is_readable($file) && !drupal_install_fix_file($file, $mask)) {
+ $return = FALSE;
+ }
+ break;
+ case FILE_WRITABLE:
+ if (!is_writable($file) && !drupal_install_fix_file($file, $mask)) {
+ $return = FALSE;
+ }
+ break;
+ case FILE_EXECUTABLE:
+ if (!is_executable($file) && !drupal_install_fix_file($file, $mask)) {
+ $return = FALSE;
+ }
+ break;
+ case FILE_NOT_READABLE:
+ if (is_readable($file) && !drupal_install_fix_file($file, $mask)) {
+ $return = FALSE;
+ }
+ break;
+ case FILE_NOT_WRITABLE:
+ if (is_writable($file) && !drupal_install_fix_file($file, $mask)) {
+ $return = FALSE;
+ }
+ break;
+ case FILE_NOT_EXECUTABLE:
+ if (is_executable($file) && !drupal_install_fix_file($file, $mask)) {
+ $return = FALSE;
+ }
+ break;
+ }
+ }
+ }
+ }
+ return $return;
+}
+
+/**
+ * Create a directory with specified permissions.
+ *
+ * @param file
+ * The name of the directory to create;
+ * @param mask
+ * The permissions of the directory to create.
+ * @param $message
+ * (optional) Whether to output messages. Defaults to TRUE.
+ *
+ * @return
+ * TRUE/FALSE whether or not the directory was successfully created.
+ */
+function drupal_install_mkdir($file, $mask, $message = TRUE) {
+ $mod = 0;
+ $masks = array(FILE_READABLE, FILE_WRITABLE, FILE_EXECUTABLE, FILE_NOT_READABLE, FILE_NOT_WRITABLE, FILE_NOT_EXECUTABLE);
+ foreach ($masks as $m) {
+ if ($mask & $m) {
+ switch ($m) {
+ case FILE_READABLE:
+ $mod += 444;
+ break;
+ case FILE_WRITABLE:
+ $mod += 222;
+ break;
+ case FILE_EXECUTABLE:
+ $mod += 111;
+ break;
+ }
+ }
+ }
+
+ if (@mkdir($file, intval("0$mod", 8))) {
+ return TRUE;
+ }
+ else {
+ return FALSE;
+ }
+}
+
+/**
+ * Attempt to fix file permissions.
+ *
+ * @param $file
+ * The name of the file with permissions to fix.
+ * @param $mask
+ * The desired permissions for the file.
+ * @param $message
+ * (optional) Whether to output messages. Defaults to TRUE.
+ *
+ * @return
+ * TRUE/FALSE whether or not we were able to fix the file's permissions.
+ */
+function drupal_install_fix_file($file, $mask, $message = TRUE) {
+ $mod = substr(sprintf('%o', fileperms($file)), -4);
+ $prefix = substr($mod, 0, 1);
+ $mod = substr($mod, 1 ,4);
+ $masks = array(FILE_READABLE, FILE_WRITABLE, FILE_EXECUTABLE, FILE_NOT_READABLE, FILE_NOT_WRITABLE, FILE_NOT_EXECUTABLE);
+ foreach ($masks as $m) {
+ if ($mask & $m) {
+ switch ($m) {
+ case FILE_READABLE:
+ if (!is_readable($file)) {
+ $mod += 444;
+ }
+ break;
+ case FILE_WRITABLE:
+ if (!is_writable($file)) {
+ $mod += 222;
+ }
+ break;
+ case FILE_EXECUTABLE:
+ if (!is_executable($file)) {
+ $mod += 111;
+ }
+ break;
+ case FILE_NOT_READABLE:
+ if (is_readable($file)) {
+ $mod -= 444;
+ }
+ break;
+ case FILE_NOT_WRITABLE:
+ if (is_writable($file)) {
+ $mod -= 222;
+ }
+ break;
+ case FILE_NOT_EXECUTABLE:
+ if (is_executable($file)) {
+ $mod -= 111;
+ }
+ break;
+ }
+ }
+ }
+
+ if (@chmod($file, intval("$prefix$mod", 8))) {
+ return TRUE;
+ }
+ else {
+ return FALSE;
+ }
+}
+
+/**
+ * Hardcoded function for doing the equivalent of theme('placeholder')
+ * when the theme system is not available.
+ */
+function st($string, $args = array()) {
+ require_once './includes/theme.inc';
+ return strtr($string, array_map('theme_placeholder', $args));
+} \ No newline at end of file
diff --git a/includes/install.mysql.inc b/includes/install.mysql.inc
new file mode 100644
index 0000000..df872f6
--- /dev/null
+++ b/includes/install.mysql.inc
@@ -0,0 +1,140 @@
+<?php
+
+// MySQL specific install functions
+
+/**
+ * Check if MySQL is available.
+ *
+ * @return
+ * TRUE/FALSE
+ */
+function mysql_is_available() {
+ return function_exists('mysql_connect');
+}
+
+/**
+ * Check if we can connect to MySQL.
+ *
+ * @return
+ * TRUE/FALSE
+ */
+function drupal_test_mysql($url, &$success) {
+ if (!mysql_is_available()) {
+ drupal_set_message('PHP MySQL support not enabled.', 'error');
+ return FALSE;
+ }
+
+ $url = parse_url($url);
+
+ // Decode url-encoded information in the db connection string.
+ $url['user'] = urldecode($url['user']);
+ $url['pass'] = urldecode($url['pass']);
+ $url['host'] = urldecode($url['host']);
+ $url['path'] = urldecode($url['path']);
+
+ // Allow for non-standard MySQL port.
+ if (isset($url['port'])) {
+ $url['host'] = $url['host'] .':'. $url['port'];
+ }
+
+ // Test connecting to the database.
+ $connection = @mysql_connect($url['host'], $url['user'], $url['pass'], TRUE, 2);
+ if (!$connection) {
+ drupal_set_message(st('Failure to connect to your MySQL database server. MySQL reports the following message: %error.<ul><li>Are you sure you have the correct username and password?</li><li>Are you sure that you have typed the correct database hostname?</li><li>Are you sure that the database server is running?</li></ul>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.', array('%error' => mysql_error())), 'error');
+ return FALSE;
+ }
+
+ // Test selecting the database.
+ if (!mysql_select_db(substr($url['path'], 1))) {
+ drupal_set_message(st('We were able to connect to the MySQL database server (which means your username and password are valid) but not able to select your database. MySQL reports the following message: %error.<ul><li>Are you sure you have the correct database name?</li><li>Are you sure the database exists?</li><li>Are you sure the username has permission to access the database?</li></ul>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.', array('%error' => mysql_error())), 'error');
+ return FALSE;
+ }
+
+ $success = array('CONNECT');
+
+ // Test CREATE.
+ $query = 'CREATE TABLE drupal_install_test (id int(1) NULL)';
+ $result = mysql_query($query);
+ if ($error = mysql_error()) {
+ drupal_set_message(st('We were unable to create a test table on your MySQL database server with the command %query. MySQL reports the following message: %error.<ul><li>Are you sure the configured username has the necessary MySQL permissions to create tables in the database?</li></ul>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.', array('%query' => $query, '%error' => $error)), 'error');
+ return FALSE;
+ }
+ $err = FALSE;
+ $success[] = 'SELECT';
+ $success[] = 'CREATE';
+
+ // Test INSERT.
+ $query = 'INSERT INTO drupal_install_test (id) VALUES (1)';
+ $result = mysql_query($query);
+ if ($error = mysql_error()) {
+ drupal_set_message(st('We were unable to insert a value into a test table on your MySQL database server. We tried inserting a value with the command %query and MySQL reported the following error: %error.', array('%query' => $query, '%error' => $error)), 'error');
+ $err = TRUE;
+ }
+ else {
+ $success[] = 'INSERT';
+ }
+
+ // Test UPDATE.
+ $query = 'UPDATE drupal_install_test SET id = 2';
+ $result = mysql_query($query);
+ if ($error = mysql_error()) {
+ drupal_set_message(st('We were unable to update a value in a test table on your MySQL database server. We tried updating a value with the command %query and MySQL reported the following error: %error.', array('%query' => $query, '%error' => $error)), 'error');
+ $err = TRUE;
+ }
+ else {
+ $success[] = 'UPDATE';
+ }
+
+ // Test LOCK.
+ $query = 'LOCK TABLES drupal_install_test WRITE';
+ $result = mysql_query($query);
+ if ($error = mysql_error()) {
+ drupal_set_message(st('We were unable to lock a test table on your MySQL database server. We tried locking a table with the command %query and MySQL reported the following error: %error.', array('%query' => $query, '%error' => $error)), 'error');
+ $err = TRUE;
+ }
+ else {
+ $success[] = 'LOCK';
+ }
+
+ // Test UNLOCK.
+ $query = 'UNLOCK TABLES';
+ $result = mysql_query($query);
+ if ($error = mysql_error()) {
+ drupal_set_message(st('We were unable to unlock a test table on your MySQL database server. We tried unlocking a table with the command %query and MySQL reported the following error: %error.', array('%query' => $query, '%error' => $error)), 'error');
+ $err = TRUE;
+ }
+ else {
+ $success[] = 'UNLOCK';
+ }
+
+ // Test DELETE.
+ $query = 'DELETE FROM drupal_install_test';
+ $result = mysql_query($query);
+ if ($error = mysql_error()) {
+ drupal_set_message(st('We were unable to delete a value from a test table on your MySQL database server. We tried deleting a value with the command %query and MySQL reported the following error: %error.', array('%query' => $query, '%error' => $error)), 'error');
+ $err = TRUE;
+ }
+ else {
+ $success[] = 'DELETE';
+ }
+
+ // Test DROP.
+ $query = 'DROP TABLE drupal_install_test';
+ $result = mysql_query($query);
+ if ($error = mysql_error()) {
+ drupal_set_message(st('We were unable to drop a test table from your MySQL database server. We tried dropping a table with the command %query and MySQL reported the following error %error.', array('%query' => $query, '%error' => $error)), 'error');
+ $err = TRUE;
+ }
+ else {
+ $success[] = 'DROP';
+ }
+
+ if ($err) {
+ return FALSE;
+ }
+
+ mysql_close($connection);
+ return TRUE;
+}
+
+?>
diff --git a/includes/install.mysqli.inc b/includes/install.mysqli.inc
new file mode 100644
index 0000000..5363da1
--- /dev/null
+++ b/includes/install.mysqli.inc
@@ -0,0 +1,140 @@
+<?php
+
+// MySQLi specific install functions
+
+/**
+ * Check if MySQLi is available.
+ *
+ * @return
+ * TRUE/FALSE
+ */
+function mysqli_is_available() {
+ return function_exists('mysqli_connect');
+}
+
+/**
+ * Check if we can connect to MySQL.
+ *
+ * @return
+ * TRUE/FALSE
+ */
+function drupal_test_mysqli($url, &$success) {
+ if (!mysqli_is_available()) {
+ drupal_set_message('PHP MySQLi support not enabled.', 'error');
+ return FALSE;
+ }
+
+ $url = parse_url($url);
+
+ // Decode url-encoded information in the db connection string.
+ $url['user'] = urldecode($url['user']);
+ $url['pass'] = urldecode($url['pass']);
+ $url['host'] = urldecode($url['host']);
+ $url['path'] = urldecode($url['path']);
+
+ // Allow for non-standard MySQL port.
+ if (isset($url['port'])) {
+ $url['host'] = $url['host'] .':'. $url['port'];
+ }
+
+ $connection = mysqli_init();
+ @mysqli_real_connect($connection, $url['host'], $url['user'], $url['pass'], substr($url['path'], 1), $url['port'], NULL, MYSQLI_CLIENT_FOUND_ROWS);
+ if (mysqli_connect_errno() >= 2000 || mysqli_connect_errno() == 1045) {
+ drupal_set_message(st('Failure to connect to your MySQL database server. MySQL reports the following message: %error.<ul><li>Are you sure you have the correct username and password?</li><li>Are you sure that you have typed the correct database hostname?</li><li>Are you sure that the database server is running?</li></ul>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.', array('%error' => mysqli_errno())), 'error');
+ return FALSE;
+ }
+
+ // Test selecting the database.
+ if (mysqli_connect_errno() > 0) {
+ drupal_set_message(st('We were able to connect to the MySQL database server (which means your username and password are valid) but not able to select your database. MySQL reports the following message: %error.<ul><li>Are you sure you have the correct database name?</li><li>Are you sure the database exists?</li><li>Are you sure the username has permission to access the database?</li></ul>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.', array('%error' => mysqli_error())), 'error');
+ return FALSE;
+ }
+
+ $success = array('CONNECT');
+
+ // Test CREATE.
+ $query = 'CREATE TABLE drupal_install_test (id int(1) NULL)';
+ $result = mysqli_query($query);
+ if ($error = mysqli_error()) {
+ drupal_set_message(st('We were unable to create a test table on your MySQL database server with the command %query. MySQL reports the following message: %error.<ul><li>Are you sure the configured username has the necessary MySQL permissions to create tables in the database?</li></ul>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.', array('%query' => $query, '%error' => $error)), 'error');
+ return FALSE;
+ }
+ $err = FALSE;
+ $success[] = 'SELECT';
+ $success[] = 'CREATE';
+
+ // Test INSERT.
+ $query = 'INSERT INTO drupal_install_test (id) VALUES (1)';
+ $result = mysqli_query($query);
+ if ($error = mysqli_error()) {
+ drupal_set_message(st('We were unable to insert a value into a test table on your MySQL database server. We tried inserting a value with the command %query and MySQL reported the following error: %error.', array('%query' => $query, '%error' => $error)), 'error');
+ $err = TRUE;
+ }
+ else {
+ $success[] = 'INSERT';
+ }
+
+ // Test UPDATE.
+ $query = 'UPDATE drupal_install_test SET id = 2';
+ $result = mysqli_query($query);
+ if ($error = mysqli_error()) {
+ drupal_set_message(st('We were unable to update a value in a test table on your MySQL database server. We tried updating a value with the command %query and MySQL reported the following error: %error.', array('%query' => $query, '%error' => $error)), 'error');
+ $err = TRUE;
+ }
+ else {
+ $success[] = 'UPDATE';
+ }
+
+ // Test LOCK.
+ $query = 'LOCK TABLES drupal_install_test WRITE';
+ $result = mysqli_query($query);
+ if ($error = mysqli_error()) {
+ drupal_set_message(st('We were unable to lock a test table on your MySQL database server. We tried locking a table with the command %query and MySQL reported the following error: %error.', array('%query' => $query, '%error' => $error)), 'error');
+ $err = TRUE;
+ }
+ else {
+ $success[] = 'LOCK';
+ }
+
+ // Test UNLOCK.
+ $query = 'UNLOCK TABLES';
+ $result = mysqli_query($query);
+ if ($error = mysqli_error()) {
+ drupal_set_message(st('We were unable to unlock a test table on your MySQL database server. We tried unlocking a table with the command %query and MySQL reported the following error: %error.', array('%query' => $query, '%error' => $error)), 'error');
+ $err = TRUE;
+ }
+ else {
+ $success[] = 'UNLOCK';
+ }
+
+ // Test DELETE.
+ $query = 'DELETE FROM drupal_install_test';
+ $result = mysqli_query($query);
+ if ($error = mysqli_error()) {
+ drupal_set_message(st('We were unable to delete a value from a test table on your MySQL database server. We tried deleting a value with the command %query and MySQL reported the following error: %error.', array('%query' => $query, '%error' => $error)), 'error');
+ $err = TRUE;
+ }
+ else {
+ $success[] = 'DELETE';
+ }
+
+ // Test DROP.
+ $query = 'DROP TABLE drupal_install_test';
+ $result = mysqli_query($query);
+ if ($error = mysqli_error()) {
+ drupal_set_message(st('We were unable to drop a test table from your MySQL database server. We tried dropping a table with the command %query and MySQL reported the following error %error.', array('%query' => $query, '%error' => $error)), 'error');
+ $err = TRUE;
+ }
+ else {
+ $success[] = 'DROP';
+ }
+
+ if ($err) {
+ return FALSE;
+ }
+
+ mysqli_close($connection);
+ return TRUE;
+}
+
+?>
diff --git a/includes/module.inc b/includes/module.inc
index 03bc4f8..5a05283 100644
--- a/includes/module.inc
+++ b/includes/module.inc
@@ -37,31 +37,42 @@ function module_iterate($function, $argument = '') {
* @param $sort
* By default, modules are ordered by weight and filename, settings this option
* to TRUE, module list will be ordered by module name.
+ * @param $fixed_list
+ * (Optional) Override the module list with the given modules. Stays until the
+ * next call with $refresh = TRUE.
* @return
* An associative array whose keys and values are the names of all loaded
* modules.
*/
-function module_list($refresh = FALSE, $bootstrap = TRUE, $sort = FALSE) {
+function module_list($refresh = FALSE, $bootstrap = TRUE, $sort = FALSE, $fixed_list = NULL) {
static $list, $sorted_list;
- if ($refresh) {
+ if ($refresh || $fixed_list) {
unset($sorted_list);
$list = array();
- if ($bootstrap) {
- $result = db_query("SELECT name, filename, throttle, bootstrap FROM {system} WHERE type = 'module' AND status = 1 AND bootstrap = 1 ORDER BY weight ASC, filename ASC");
+ if ($fixed_list) {
+ foreach ($fixed_list as $name => $module) {
+ drupal_get_filename('module', $name, $module['filename']);
+ $list[$name] = $name;
+ }
}
else {
- $result = db_query("SELECT name, filename, throttle, bootstrap FROM {system} WHERE type = 'module' AND status = 1 ORDER BY weight ASC, filename ASC");
- }
- while ($module = db_fetch_object($result)) {
- if (file_exists($module->filename)) {
- // Determine the current throttle status and see if the module should be
- // loaded based on server load. We have to directly access the throttle
- // variables, since throttle.module may not be loaded yet.
- $throttle = ($module->throttle && variable_get('throttle_level', 0) > 0);
- if (!$throttle) {
- drupal_get_filename('module', $module->name, $module->filename);
- $list[$module->name] = $module->name;
+ if ($bootstrap) {
+ $result = db_query("SELECT name, filename, throttle, bootstrap FROM {system} WHERE type = 'module' AND status = 1 AND bootstrap = 1 ORDER BY weight ASC, filename ASC");
+ }
+ else {
+ $result = db_query("SELECT name, filename, throttle, bootstrap FROM {system} WHERE type = 'module' AND status = 1 ORDER BY weight ASC, filename ASC");
+ }
+ while ($module = db_fetch_object($result)) {
+ if (file_exists($module->filename)) {
+ // Determine the current throttle status and see if the module should be
+ // loaded based on server load. We have to directly access the throttle
+ // variables, since throttle.module may not be loaded yet.
+ $throttle = ($module->throttle && variable_get('throttle_level', 0) > 0);
+ if (!$throttle) {
+ drupal_get_filename('module', $module->name, $module->filename);
+ $list[$module->name] = $module->name;
+ }
}
}
}
diff --git a/includes/theme.inc b/includes/theme.inc
index 715a427..47388c8 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -431,7 +431,7 @@ function theme_maintenance_page($content, $messages = TRUE, $partial = FALSE) {
$output = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
$output .= '<html xmlns="http://www.w3.org/1999/xhtml">';
$output .= '<head>';
- $output .= ' <title>'. drupal_get_title() .'</title>';
+ $output .= ' <title>'. strip_tags(drupal_get_title()) .'</title>';
$output .= drupal_get_html_head();
$output .= theme_get_styles();
$output .= '</head>';
@@ -453,33 +453,69 @@ function theme_maintenance_page($content, $messages = TRUE, $partial = FALSE) {
return $output;
}
+function theme_install_page($content) {
+ drupal_set_header('Content-Type: text/html; charset=utf-8');
+ theme('add_style', 'misc/maintenance.css');
+ drupal_set_html_head('<link rel="shortcut icon" href="'. base_path() .'misc/favicon.ico" type="image/x-icon" />');
+ $output = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
+ $output .= '<html xmlns="http://www.w3.org/1999/xhtml">';
+ $output .= '<head>';
+ $output .= ' <title>'. strip_tags(drupal_get_title()) .'</title>';
+ $output .= drupal_get_html_head();
+ $output .= theme_get_styles();
+ $output .= '</head>';
+ $output .= '<body>';
+ $output .= '<h1>' . drupal_get_title() . '</h1>';
+
+ $messages = drupal_set_message();
+ if (isset($messages['error'])) {
+ $errors = count($messages['error']) > 1 ? 'errors' : 'error';
+ $output .= "<h3>The following $errors must be resolved before you can continue the installation process:</h3>";
+ $output .= theme('status_messages', 'error');
+ }
+
+ $output .= "\n<!-- begin content -->\n";
+ $output .= $content;
+ $output .= "\n<!-- end content -->\n";
+
+ if (isset($messages['status'])) {
+ $warnings = count($messages['status']) > 1 ? 'warnings' : 'warning';
+ $output .= "<h4>The following installation $warnings should be carefully reviewed, but in most cases may be safely ignored:</h4>";
+ $output .= theme('status_messages', 'status');
+ }
+
+ $output .= '</body></html>';
+
+ return $output;
+}
+
/**
- * Returns themed set of status and/or error messages. The messages are grouped
+ * Return a themed set of status and/or error messages. The messages are grouped
* by type.
*
+ * @param $display
+ * (optional) Set to 'status' or 'error' to display only messages of that type.
+ *
* @return
* A string containing the messages.
*/
-function theme_status_messages() {
- if ($data = drupal_get_messages()) {
- $output = '';
- foreach ($data as $type => $messages) {
- $output .= "<div class=\"messages $type\">\n";
- if (count($messages) > 1) {
- $output .= " <ul>\n";
- foreach($messages as $message) {
- $output .= ' <li>'. $message ."</li>\n";
- }
- $output .= " </ul>\n";
- }
- else {
- $output .= $messages[0];
+function theme_status_messages($display = NULL) {
+ $output = '';
+ foreach (drupal_get_messages($display) as $type => $messages) {
+ $output .= "<div class=\"messages $type\">\n";
+ if (count($messages) > 1) {
+ $output .= " <ul>\n";
+ foreach($messages as $message) {
+ $output .= ' <li>'. $message ."</li>\n";
}
- $output .= "</div>\n";
+ $output .= " </ul>\n";
}
-
- return $output;
+ else {
+ $output .= $messages[0];
+ }
+ $output .= "</div>\n";
}
+ return $output;
}
/**
diff --git a/install.php b/install.php
new file mode 100644
index 0000000..a37ffa7
--- /dev/null
+++ b/install.php
@@ -0,0 +1,417 @@
+<?php
+// $Id$
+
+$install = TRUE;
+require_once './includes/install.inc';
+
+/**
+ * The Drupal installation happens in a series of steps. We begin by verifying
+ * that the current environment meets our minimum requirements. We then go
+ * on to verify that settings.php is properly configured. From there we
+ * connect to the configured database and verify that it meets our minimum
+ * requirements. Finally we can allow the user to select an installation
+ * profile and complete the installation process.
+ *
+ * @param $phase
+ * The installation phase we should proceed to.
+ */
+function install_main() {
+ global $profile;
+ require_once './includes/bootstrap.inc';
+ drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION);
+ require_once './modules/system/system.install';
+
+ // Check existing settings.php.
+ $verify = install_verify_settings();
+
+ // Drupal may already be installed.
+ if ($verify) {
+ // Establish a connection to the database.
+ require_once './includes/database.inc';
+ db_set_active();
+
+ // Check if Drupal is installed.
+ if (install_verify_drupal()) {
+ install_already_done_error();
+ }
+ }
+
+ // Load module basics (needed for hook invokes).
+ include_once './includes/module.inc';
+ $module_list['system']['filename'] = 'modules/system/system.module';
+ $module_list['filter']['filename'] = 'modules/filter/filter.module';
+ module_list(TRUE, FALSE, FALSE, $module_list);
+ drupal_load('module', 'system');
+ drupal_load('module', 'filter');
+
+ // Decide which profile to use.
+ if (!empty($_GET['profile'])) {
+ $profile = preg_replace('/[^a-zA-Z_0-9]/', '', $_GET['profile']);
+ }
+ elseif ($profile = install_select_profile()) {
+ _install_goto("install.php?profile=$profile");
+ }
+ else {
+ _install_no_profile_error();
+ }
+ // Load the profile.
+ require_once "./profiles/$profile.profile";
+
+ // Change the settings.php information if verification failed earlier.
+ if (!$verify) {
+ install_change_settings();
+ }
+
+ // Perform actual installation defined in the profile.
+ drupal_install_profile($profile);
+
+ // Warn about settings.php permissions risk
+ $settings_file = './'. conf_path() .'/settings.php';
+ if (!drupal_verify_install_file($settings_file, FILE_EXIST|FILE_READABLE|FILE_NOT_WRITABLE)) {
+ drupal_set_message(st('All necessary changes to %file have been made, so you should now remove write permissions to this file. Failure to remove write permissions to this file is a security risk.', array('%file' => $settings_file)), 'error');
+ }
+
+ // Show end page.
+ install_complete($profile);
+}
+
+/**
+ * Verify if Drupal is installed.
+ */
+function install_verify_drupal() {
+ $result = @db_query("SELECT name FROM {system} WHERE name = 'system'");
+ return $result && db_result($result) == 'system';
+}
+
+/**
+ * Verify existing settings.php
+ */
+function install_verify_settings() {
+ global $db_prefix, $db_type, $db_url;
+
+ // Verify existing settings (if any).
+ if ($_SERVER['REQUEST_METHOD'] == 'GET' && $db_url != 'mysql://username:password@localhost/databasename') {
+ // We need this because we want to run form_get_errors.
+ include_once './includes/form.inc';
+
+ $url = parse_url($db_url);
+ $db_user = urldecode($url['user']);
+ $db_pass = urldecode($url['pass']);
+ $db_host = urldecode($url['host']);
+ $db_path = ltrim(urldecode($url['path']), '/');
+ $settings_file = './'. conf_path() .'/settings.php';
+
+ _install_settings_validate($db_prefix, $db_type, $db_user, $db_pass, $db_host, $db_path, $settings_file);
+ if (!form_get_errors()) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+/**
+ * Configure and rewrite settings.php.
+ */
+function install_change_settings() {
+ global $profile, $db_url, $db_type, $db_prefix;
+
+ $url = parse_url($db_url);
+ $db_user = urldecode($url['user']);
+ $db_pass = urldecode($url['pass']);
+ $db_host = urldecode($url['host']);
+ $db_path = ltrim(urldecode($url['path']), '/');
+ $settings_file = './'. conf_path() .'/settings.php';
+
+ // We always need this because we want to run form_get_errors.
+ include_once './includes/form.inc';
+
+ // The existing database settings are not working, so we need write access
+ // to settings.php to change them.
+ if (!drupal_verify_install_file($settings_file, FILE_EXIST|FILE_READABLE|FILE_WRITABLE)) {
+ drupal_maintenance_theme();
+ drupal_set_message(st('The Drupal installer requires write permissions to %file during the installation process.', array('%file' => $settings_file)), 'error');
+
+ drupal_set_title('Drupal installation');
+ print theme('install_page', '');
+ exit;
+ }
+
+ // Don't fill in placeholders
+ if ($db_url == 'mysql://username:password@localhost/databasename') {
+ $db_user = $db_pass = $db_path = '';
+ }
+
+ // Database type
+ $form['db_type'] = array(
+ '#type' => 'select',
+ '#title' => 'Database type',
+ '#required' => TRUE,
+ '#options' => drupal_detect_database_types(),
+ '#default_value' => $db_type,
+ '#description' => st('Select the type of database you would like to use with your %drupal installation. If you do not find your preferred database type listed here, verify that the database type is <a href="http://drupal.org/node/270#database">supported by Drupal</a> then confirm that it is properly installed and accessible from PHP. Only properly installed databases that are accessible from PHP and recognized by %drupal are displayed in this menu.', array('%drupal' => drupal_install_profile_name())),
+ );
+ // Database username
+ $form['db_user'] = array(
+ '#type' => 'textfield',
+ '#title' => 'Database username',
+ '#default_value' => $db_user,
+ '#size' => 45,
+ '#maxlength' => 45,
+ '#required' => TRUE,
+ '#description' => st('The database username that your %drupal installation will use to connect to your database server.', array('%drupal' => drupal_install_profile_name())),
+ );
+
+ // Database username
+ $form['db_pass'] = array(
+ '#type' => 'password',
+ '#title' => 'Database password',
+ '#default_value' => $db_pass,
+ '#size' => 45,
+ '#maxlength' => 45,
+ '#required' => TRUE,
+ '#description' => st('The database password that your %drupal installation will use to connect to your database server.', array('%drupal' => drupal_install_profile_name())),
+ );
+
+ // Database name
+ $form['db_path'] = array(
+ '#type' => 'textfield',
+ '#title' => 'Database name',
+ '#default_value' => $db_path,
+ '#size' => 45,
+ '#maxlength' => 45,
+ '#required' => TRUE,
+ '#description' => st('The name of the database where %drupal can install its database tables.', array('%drupal' => drupal_install_profile_name())),
+ );
+
+ // Database host
+ $form['db_host'] = array(
+ '#type' => 'textfield',
+ '#title' => 'Database host',
+ '#default_value' => $db_host,
+ '#size' => 45,
+ '#maxlength' => 45,
+ '#required' => TRUE,
+ '#description' => st('The hostname or IP address of your database server. If your database server is on the same machine as you are installing %drupal, you should probably enter %localhost.', array('%drupal' => drupal_install_profile_name(), '%localhost' => 'localhost')),
+ );
+
+ // Database prefix
+ $form['db_prefix'] = array(
+ '#type' => 'textfield',
+ '#title' => 'Database prefix',
+ '#default_value' => $db_prefix,
+ '#size' => 45,
+ '#maxlength' => 45,
+ '#required' => FALSE,
+ '#description' => 'Optionally set a prefix for all database table names. If a prefix is specified, all table names will be prepended with this value. Only alphanumeric characters and the underscore are allowed. If you do not wish to use a prefix, leave this field empty. If you wish to only prefix specific tables, you will need to manually edit your <em>settings.php</em> configuration file.',
+ );
+
+ $form['save'] = array(
+ '#type' => 'submit',
+ '#value' => 'Save configuration',
+ );
+ $form['errors'] = array();
+ $form['settings_file'] = array('#type' => 'value', '#value' => $settings_file);
+ $form['_db_url'] = array('#type' => 'value');
+ $form['#action'] = "install.php?profile=$profile";
+ $form['#redirect'] = NULL;
+ drupal_maintenance_theme();
+ $output = drupal_get_form('install_settings', $form);
+ drupal_set_title('Database configuration');
+ print theme('install_page', st('<p>Please fill out the following information to configure your %drupal site.</p>', array('%drupal' => drupal_install_profile_name())). $output);
+ exit;
+}
+
+/**
+ * Form API validate for install_settings form.
+ */
+function install_settings_validate($form_id, $form_values, $form) {
+ global $db_url;
+ _install_settings_validate($form_values['db_prefix'], $form_values['db_type'], $form_values['db_user'], $form_values['db_pass'], $form_values['db_host'], $form_values['db_path'], $form_values['settings_file'], $form);
+}
+
+/**
+ * Helper function for install_settings_validate.
+ */
+function _install_settings_validate($db_prefix, $db_type, $db_user, $db_pass, $db_host, $db_path, $settings_file, $form = NULL) {
+ global $db_url;
+
+ // Check for default username/password
+ if ($db_user == 'username' && $db_pass == 'password') {
+ form_set_error('db_user', st('You have configured %drupal to use the default username and password. This is not allowed for security reasons.', array('%drupal' => drupal_install_profile_name())));
+ }
+
+ // Verify database prefix
+ if (!empty($db_prefix) && preg_match('/[^A-Za-z0-9_]/', $db_prefix)) {
+ form_set_error('db_prefix', st('The database prefix you have entered, %db_prefix, is invalid. The database prefix can only contain alphanumeric characters and underscores.', array('%db_prefix' => $db_prefix)), 'error');
+ }
+
+ // Check database type
+ if (!isset($form)) {
+ $db_type = substr($db_url, 0, strpos($db_url, '://'));
+ }
+ $databases = drupal_detect_database_types();
+ if (!in_array($db_type, $databases)) {
+ form_set_error('db_type', st("In your %settings_file file you have configured Drupal to use a %db_type server, however your PHP installation currently does not support this database type.", array('%settings_file' => $settings_file, '%db_type' => $db_type)));
+ }
+ else {
+ // Verify
+ $db_url = $db_type .'://'. urlencode($db_user) .($db_pass ? ':'. urlencode($db_pass) : '') .'@'. ($db_host ? urlencode($db_host) : 'localhost') .'/'. urlencode($db_path);
+ if (isset($form)) {
+ form_set_value($form['_db_url'], $db_url);
+ }
+ $success = array();
+
+ $function = 'drupal_test_'. $db_type;
+ if (!$function($db_url, $success)) {
+ if (isset($success['CONNECT'])) {
+ form_set_error('db_type', st('In order for Drupal to work and to proceed with the installation process you must resolve all permission issues reported above. We were able to verify that we have permission for the following commands: %commands. For more help with configuring your database server, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what any of this means you should probably contact your hosting provider.', array('%commands' => implode($success, ', '))));
+ }
+ else {
+ form_set_error('db_type', '');
+ }
+ }
+ }
+}
+
+/**
+ * Form API submit for install_settings form.
+ */
+function install_settings_submit($form_id, $form_values) {
+ global $profile;
+
+ // Update global settings array and save
+ $settings['db_url'] = array(
+ 'value' => $form_values['_db_url'],
+ 'required' => TRUE,
+ );
+ $settings['db_prefix'] = array(
+ 'value' => $form_values['db_prefix'],
+ 'required' => TRUE,
+ );
+ drupal_rewrite_settings($settings);
+
+ // Continue to install profile step
+ _install_goto("install.php?profile=$profile");
+}
+
+/**
+ * Find all .profile files and allow admin to select which to install.
+ *
+ * @return
+ * The selected profile.
+ */
+function install_select_profile() {
+ include_once './includes/file.inc';
+ include_once './includes/form.inc';
+
+ $profiles = file_scan_directory('./profiles', '\.profile$', array('.', '..', 'CVS'), 0, TRUE, 'name', 0);
+ // Don't need to choose profile if only one available.
+ if (sizeof($profiles) == 1) {
+ $profile = array_pop($profiles);
+ require_once $profile->filename;
+ return $profile->name;
+ }
+ elseif (sizeof($profiles) > 1) {
+ drupal_maintenance_theme();
+ $form = '';
+ foreach ($profiles as $profile) {
+ include_once($profile->filename);
+ if ($_POST['edit']['profile'] == $profile->name) {
+ return $profile->name;
+ }
+ // Load profile details.
+ $function = $profile->name .'_profile_details';
+ if (function_exists($function)) {
+ $details = $function();
+ }
+
+ // If set, used defined name. Otherwise use file name.
+ $name = isset($details['name']) ? $details['name'] : $profile->name;
+
+ $form['profile'][$name] = array(
+ '#type' => 'radio',
+ '#value' => 'default',
+ '#return_value' => $profile->name,
+ '#title' => $name,
+ '#description' => isset($details['description']) ? $details['description'] : '',
+ '#parents' => array('profile'),
+ );
+ }
+ $form['submit'] = array(
+ '#type' => 'submit',
+ '#value' => 'Save configuration',
+ );
+
+ drupal_set_title('Select an installation profile');
+ print theme('install_page', drupal_get_form('install_select_profile', $form));
+ exit;
+ }
+}
+
+/**
+ * Show an error page when there are no profiles available.
+ */
+function install_no_profile_error() {
+ drupal_maintenance_theme();
+ drupal_set_title('No profiles available');
+ print theme('install_page', '<p>We were unable to find any installer profiles. Installer profiles tell us what modules to enable and what schema to install in the database. A profile is necessary to continue with the installation process.</p>');
+ exit;
+}
+
+
+/**
+ * Show an error page when Drupal has already been installed.
+ */
+function install_already_done_error() {
+ drupal_maintenance_theme();
+ drupal_set_title('Drupal already installed');
+ print theme('install_page', '<p>Drupal has already been installed on this site. To start over, you must empty your existing database. To install to a different database, edit the appropriate <em>settings.php</em> file in the <em>sites</em> folder.</p>');
+ exit;
+}
+
+/**
+ * Page displayed when the installation is complete. Called from install.php.
+ */
+function install_complete($profile) {
+ global $base_url;
+
+ // Bootstrap newly installed Drupal, while preserving existing messages.
+ $messages = $_SESSION['messages'];
+ drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
+ $_SESSION['messages'] = $messages;
+
+ // Build final page.
+ drupal_maintenance_theme();
+ drupal_set_title(st('%drupal installation complete', array('%drupal' => drupal_install_profile_name())));
+ $output = st('<p>Congratulations, %drupal has been successfully installed.</p>', array('%drupal' => drupal_install_profile_name()));
+
+ // Show profile finalization info.
+ $function = $profile .'_profile_final';
+ if (function_exists($function)) {
+ // More steps required
+ $output .= $function();
+ }
+ else {
+ // No more steps
+ $msg = drupal_set_message() ? 'Please review the messages above before continuing on to <a href="%url">your new site</a>.' : 'You may now visit <a href="%url">your new site</a>.';
+ $output .= strtr('<p>'. $msg .'</p>', array('%url' => url('')));
+ }
+
+ // Output page.
+ print theme('maintenance_page', $output);
+}
+
+/**
+ * Send the user to a different installer page. This issues an on-site HTTP
+ * redirect. Messages (and errors) are erased.
+ *
+ * @param $path
+ * An installer path.
+ */
+function _install_goto($path) {
+ global $base_path;
+ header('Location: '. $base_path . $path);
+ exit();
+}
+
+install_main();
diff --git a/misc/maintenance.css b/misc/maintenance.css
index de8e5be..032d56c 100644
--- a/misc/maintenance.css
+++ b/misc/maintenance.css
@@ -6,6 +6,7 @@ body {
border: 1px solid #bbb;
margin: 3em;
padding: 1em 1em 1em 128px;
+ line-height: 1.2;
}
h1 {
margin: 1.6em 0 1.1em 0;
@@ -28,8 +29,15 @@ div.messages {
margin-top: 1em;
}
+div.messages li {
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+}
+
div.error {
+ background: #fdd;
border: 1px solid #daa;
+ color: #400;
}
/* Update styles */
diff --git a/modules/aggregator/aggregator.install b/modules/aggregator/aggregator.install
new file mode 100644
index 0000000..4c03b31
--- /dev/null
+++ b/modules/aggregator/aggregator.install
@@ -0,0 +1,58 @@
+<?php
+
+function aggregator_install() {
+ switch ($GLOBALS['db_type']) {
+ case 'mysql':
+ case 'mysqli':
+ db_query("CREATE TABLE {aggregator_category} (
+ cid int(10) NOT NULL auto_increment,
+ title varchar(255) NOT NULL default '',
+ description longtext NOT NULL,
+ block tinyint(2) NOT NULL default '0',
+ PRIMARY KEY (cid),
+ UNIQUE KEY title (title)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {aggregator_category_feed} (
+ fid int(10) NOT NULL default '0',
+ cid int(10) NOT NULL default '0',
+ PRIMARY KEY (fid,cid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {aggregator_category_item} (
+ iid int(10) NOT NULL default '0',
+ cid int(10) NOT NULL default '0',
+ PRIMARY KEY (iid,cid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {aggregator_feed} (
+ fid int(10) NOT NULL auto_increment,
+ title varchar(255) NOT NULL default '',
+ url varchar(255) NOT NULL default '',
+ refresh int(10) NOT NULL default '0',
+ checked int(10) NOT NULL default '0',
+ link varchar(255) NOT NULL default '',
+ description longtext NOT NULL,
+ image longtext NOT NULL,
+ etag varchar(255) NOT NULL default '',
+ modified int(10) NOT NULL default '0',
+ block tinyint(2) NOT NULL default '0',
+ PRIMARY KEY (fid),
+ UNIQUE KEY link (url),
+ UNIQUE KEY title (title)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {aggregator_item} (
+ iid int(10) NOT NULL auto_increment,
+ fid int(10) NOT NULL default '0',
+ title varchar(255) NOT NULL default '',
+ link varchar(255) NOT NULL default '',
+ author varchar(255) NOT NULL default '',
+ description longtext NOT NULL,
+ timestamp int(11) default NULL,
+ PRIMARY KEY (iid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ break;
+ }
+}
diff --git a/modules/book/book.install b/modules/book/book.install
new file mode 100644
index 0000000..7e80ccd
--- /dev/null
+++ b/modules/book/book.install
@@ -0,0 +1,17 @@
+<?php
+
+function book_install() {
+ switch ($GLOBALS['db_type']) {
+ case 'mysql':
+ case 'mysqli':
+ db_query("CREATE TABLE {book} (
+ vid int(10) unsigned NOT NULL default '0',
+ nid int(10) unsigned NOT NULL default '0',
+ parent int(10) NOT NULL default '0',
+ weight tinyint(3) NOT NULL default '0',
+ PRIMARY KEY (vid),
+ KEY nid (nid),
+ KEY parent (parent)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+ }
+} \ No newline at end of file
diff --git a/modules/contact/contact.install b/modules/contact/contact.install
new file mode 100644
index 0000000..b5f2ae6
--- /dev/null
+++ b/modules/contact/contact.install
@@ -0,0 +1,18 @@
+<?php
+
+function contact_install() {
+ switch ($GLOBALS['db_type']) {
+ case 'mysql':
+ case 'mysqli':
+ db_query("CREATE TABLE {contact} (
+ cid int(10) unsigned NOT NULL auto_increment,
+ category varchar(255) NOT NULL default '',
+ recipients longtext NOT NULL default '',
+ reply longtext NOT NULL default '',
+ weight tinyint(3) NOT NULL default '0',
+ selected tinyint(1) NOT NULL default '0',
+ PRIMARY KEY (cid),
+ UNIQUE KEY category (category)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+ }
+} \ No newline at end of file
diff --git a/modules/drupal/drupal.install b/modules/drupal/drupal.install
new file mode 100644
index 0000000..c5cc052
--- /dev/null
+++ b/modules/drupal/drupal.install
@@ -0,0 +1,29 @@
+<?php
+
+function drupal_install() {
+ switch ($GLOBALS['db_type']) {
+ case 'mysql':
+ case 'mysqli':
+ db_query("CREATE TABLE {client} (
+ cid int(10) unsigned NOT NULL auto_increment,
+ link varchar(255) NOT NULL default '',
+ name varchar(128) NOT NULL default '',
+ mail varchar(128) NOT NULL default '',
+ slogan longtext NOT NULL,
+ mission longtext NOT NULL,
+ users int(10) NOT NULL default '0',
+ nodes int(10) NOT NULL default '0',
+ version varchar(35) NOT NULL default'',
+ created int(11) NOT NULL default '0',
+ changed int(11) NOT NULL default '0',
+ PRIMARY KEY (cid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {client_system} (
+ cid int(10) NOT NULL default '0',
+ name varchar(255) NOT NULL default '',
+ type varchar(255) NOT NULL default '',
+ PRIMARY KEY (cid,name)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+ }
+} \ No newline at end of file
diff --git a/modules/forum/forum.install b/modules/forum/forum.install
new file mode 100644
index 0000000..443cbdf
--- /dev/null
+++ b/modules/forum/forum.install
@@ -0,0 +1,16 @@
+<?php
+
+function forum_install() {
+ switch ($GLOBALS['db_type']) {
+ case 'mysql':
+ case 'mysqli':
+ db_query("CREATE TABLE {forum} (
+ nid int(10) unsigned NOT NULL default '0',
+ vid int(10) unsigned NOT NULL default '0',
+ tid int(10) unsigned NOT NULL default '0',
+ PRIMARY KEY (vid),
+ KEY nid (nid),
+ KEY tid (tid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+ }
+} \ No newline at end of file
diff --git a/modules/locale/locale.install b/modules/locale/locale.install
new file mode 100644
index 0000000..b7b78ad
--- /dev/null
+++ b/modules/locale/locale.install
@@ -0,0 +1,37 @@
+<?php
+
+function locale_install() {
+ switch ($GLOBALS['db_type']) {
+ case 'mysql':
+ case 'mysqli':
+ db_query("CREATE TABLE {locales_meta} (
+ locale varchar(12) NOT NULL default '',
+ name varchar(64) NOT NULL default '',
+ enabled int(2) NOT NULL default '0',
+ isdefault int(2) NOT NULL default '0',
+ plurals int(1) NOT NULL default '0',
+ formula varchar(128) NOT NULL default '',
+ PRIMARY KEY (locale)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {locales_source} (
+ lid int(11) NOT NULL auto_increment,
+ location varchar(255) NOT NULL default '',
+ source blob NOT NULL,
+ PRIMARY KEY (lid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {locales_target} (
+ lid int(11) NOT NULL default '0',
+ translation blob NOT NULL,
+ locale varchar(12) NOT NULL default '',
+ plid int(11) NOT NULL default '0',
+ plural int(1) NOT NULL default '0',
+ KEY lid (lid),
+ KEY lang (locale),
+ KEY plid (plid),
+ KEY plural (plural)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+ }
+ db_query("INSERT INTO {locales_meta} (locale, name, enabled, isdefault) VALUES ('en', 'English', '1', '1')");
+}
diff --git a/modules/poll/poll.install b/modules/poll/poll.install
new file mode 100644
index 0000000..6ce2dbb
--- /dev/null
+++ b/modules/poll/poll.install
@@ -0,0 +1,34 @@
+<?php
+
+function poll_install() {
+ switch ($GLOBALS['db_type']) {
+ case 'mysql':
+ case 'mysqli':
+ db_query("CREATE TABLE {poll} (
+ nid int(10) unsigned NOT NULL default '0',
+ runtime int(10) NOT NULL default '0',
+ active int(2) unsigned NOT NULL default '0',
+ PRIMARY KEY (nid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {poll_votes} (
+ nid int(10) unsigned NOT NULL,
+ uid int(10) unsigned NOT NULL default 0,
+ chorder int(10) NOT NULL default -1,
+ hostname varchar(128) NOT NULL default '',
+ INDEX (nid),
+ INDEX (uid),
+ INDEX (hostname)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {poll_choices} (
+ chid int(10) unsigned NOT NULL auto_increment,
+ nid int(10) unsigned NOT NULL default '0',
+ chtext varchar(128) NOT NULL default '',
+ chvotes int(6) NOT NULL default '0',
+ chorder int(2) NOT NULL default '0',
+ PRIMARY KEY (chid),
+ KEY nid (nid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+ }
+}
diff --git a/modules/profile/profile.install b/modules/profile/profile.install
new file mode 100644
index 0000000..2c83adf
--- /dev/null
+++ b/modules/profile/profile.install
@@ -0,0 +1,34 @@
+<?php
+
+function profile_install() {
+ switch ($GLOBALS['db_type']) {
+ case 'mysql':
+ case 'mysqli':
+ db_query("CREATE TABLE {profile_fields} (
+ fid int(10) NOT NULL auto_increment,
+ title varchar(255) default NULL,
+ name varchar(128) default NULL,
+ explanation TEXT default NULL,
+ category varchar(255) default NULL,
+ page varchar(255) default NULL,
+ type varchar(128) default NULL,
+ weight tinyint(1) DEFAULT '0' NOT NULL,
+ required tinyint(1) DEFAULT '0' NOT NULL,
+ register tinyint(1) DEFAULT '0' NOT NULL,
+ visibility tinyint(1) DEFAULT '0' NOT NULL,
+ autocomplete tinyint(1) DEFAULT '0' NOT NULL,
+ options text,
+ KEY category (category),
+ UNIQUE KEY name (name),
+ PRIMARY KEY (fid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {profile_values} (
+ fid int(10) unsigned default '0',
+ uid int(10) unsigned default '0',
+ value text,
+ KEY uid (uid),
+ KEY fid (fid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+ }
+} \ No newline at end of file
diff --git a/modules/search/search.install b/modules/search/search.install
new file mode 100644
index 0000000..61481d5
--- /dev/null
+++ b/modules/search/search.install
@@ -0,0 +1,32 @@
+<?php
+
+function search_install() {
+ switch ($GLOBALS['db_type']) {
+ case 'mysql':
+ case 'mysqli':
+ db_query("CREATE TABLE {search_dataset} (
+ sid int(10) unsigned NOT NULL default '0',
+ type varchar(16) default NULL,
+ data longtext NOT NULL,
+ KEY sid_type (sid, type)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {search_index} (
+ word varchar(50) NOT NULL default '',
+ sid int(10) unsigned NOT NULL default '0',
+ type varchar(16) default NULL,
+ fromsid int(10) unsigned NOT NULL default '0',
+ fromtype varchar(16) default NULL,
+ score float default NULL,
+ KEY sid_type (sid, type),
+ KEY from_sid_type (fromsid, fromtype),
+ KEY word (word)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {search_total} (
+ word varchar(50) NOT NULL default '',
+ count float default NULL,
+ PRIMARY KEY (word)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+ }
+} \ No newline at end of file
diff --git a/modules/statistics/statistics.install b/modules/statistics/statistics.install
new file mode 100644
index 0000000..c6dd690
--- /dev/null
+++ b/modules/statistics/statistics.install
@@ -0,0 +1,21 @@
+<?php
+
+function statistics_install() {
+ switch ($GLOBALS['db_type']) {
+ case 'mysql':
+ case 'mysqli':
+ db_query("CREATE TABLE {accesslog} (
+ aid int(10) NOT NULL auto_increment,
+ sid varchar(32) NOT NULL default '',
+ title varchar(255) default NULL,
+ path varchar(255) default NULL,
+ url varchar(255) default NULL,
+ hostname varchar(128) default NULL,
+ uid int(10) unsigned default '0',
+ timer int(10) unsigned NOT NULL default '0',
+ timestamp int(11) unsigned NOT NULL default '0',
+ KEY accesslog_timestamp (timestamp),
+ PRIMARY KEY (aid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+ }
+} \ No newline at end of file
diff --git a/database/updates.inc b/modules/system/system.install
index f9f4bff..9378bb6 100644
--- a/database/updates.inc
+++ b/modules/system/system.install
@@ -1,5 +1,426 @@
<?php
-// $Id$
+
+function system_install() {
+ switch ($GLOBALS['db_type']) {
+ case 'mysql':
+ case 'mysqli':
+ db_query("CREATE TABLE {access} (
+ aid tinyint(10) NOT NULL auto_increment,
+ mask varchar(255) NOT NULL default '',
+ type varchar(255) NOT NULL default '',
+ status tinyint(2) NOT NULL default '0',
+ PRIMARY KEY (aid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {authmap} (
+ aid int(10) unsigned NOT NULL auto_increment,
+ uid int(10) NOT NULL default '0',
+ authname varchar(128) NOT NULL default '',
+ module varchar(128) NOT NULL default '',
+ PRIMARY KEY (aid),
+ UNIQUE KEY authname (authname)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {blocks} (
+ module varchar(64) DEFAULT '' NOT NULL,
+ delta varchar(32) NOT NULL default '0',
+ theme varchar(255) NOT NULL default '',
+ status tinyint(2) DEFAULT '0' NOT NULL,
+ weight tinyint(1) DEFAULT '0' NOT NULL,
+ region varchar(64) DEFAULT 'left' NOT NULL,
+ custom tinyint(2) DEFAULT '0' NOT NULL,
+ throttle tinyint(1) DEFAULT '0' NOT NULL,
+ visibility tinyint(1) DEFAULT '0' NOT NULL,
+ pages text DEFAULT '' NOT NULL
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {boxes} (
+ bid tinyint(4) NOT NULL auto_increment,
+ title varchar(64) NOT NULL default '',
+ body longtext,
+ info varchar(128) NOT NULL default '',
+ format int(4) NOT NULL default '0',
+ PRIMARY KEY (bid),
+ UNIQUE KEY info (info)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {cache} (
+ cid varchar(255) NOT NULL default '',
+ data longblob,
+ expire int(11) NOT NULL default '0',
+ created int(11) NOT NULL default '0',
+ headers text,
+ PRIMARY KEY (cid),
+ INDEX expire (expire)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {comments} (
+ cid int(10) NOT NULL auto_increment,
+ pid int(10) NOT NULL default '0',
+ nid int(10) NOT NULL default '0',
+ uid int(10) NOT NULL default '0',
+ subject varchar(64) NOT NULL default '',
+ comment longtext NOT NULL,
+ hostname varchar(128) NOT NULL default '',
+ timestamp int(11) NOT NULL default '0',
+ score mediumint(9) NOT NULL default '0',
+ status tinyint(3) unsigned NOT NULL default '0',
+ format int(4) NOT NULL default '0',
+ thread varchar(255) NOT NULL,
+ users longtext,
+ name varchar(60) default NULL,
+ mail varchar(64) default NULL,
+ homepage varchar(255) default NULL,
+ PRIMARY KEY (cid),
+ KEY lid (nid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {node_comment_statistics} (
+ nid int(10) unsigned NOT NULL auto_increment,
+ last_comment_timestamp int(11) NOT NULL default '0',
+ last_comment_name varchar(60) default NULL,
+ last_comment_uid int(10) NOT NULL default '0',
+ comment_count int(10) unsigned NOT NULL default '0',
+ PRIMARY KEY (nid),
+ KEY node_comment_timestamp (last_comment_timestamp)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {files} (
+ fid int(10) unsigned NOT NULL default 0,
+ nid int(10) unsigned NOT NULL default 0,
+ filename varchar(255) NOT NULL default '',
+ filepath varchar(255) NOT NULL default '',
+ filemime varchar(255) NOT NULL default '',
+ filesize int(10) unsigned NOT NULL default 0,
+ PRIMARY KEY (fid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {file_revisions} (
+ fid int(10) unsigned NOT NULL default 0,
+ vid int(10) unsigned NOT NULL default 0,
+ description varchar(255) NOT NULL default '',
+ list tinyint(1) unsigned NOT NULL default 0,
+ PRIMARY KEY (fid, vid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {filter_formats} (
+ format int(4) NOT NULL auto_increment,
+ name varchar(255) NOT NULL default '',
+ roles varchar(255) NOT NULL default '',
+ cache tinyint(2) NOT NULL default '0',
+ PRIMARY KEY (format),
+ UNIQUE KEY (name)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {filters} (
+ format int(4) NOT NULL default '0',
+ module varchar(64) NOT NULL default '',
+ delta tinyint(2) DEFAULT '0' NOT NULL,
+ weight tinyint(2) DEFAULT '0' NOT NULL,
+ INDEX (weight)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {flood} (
+ event varchar(64) NOT NULL default '',
+ hostname varchar(128) NOT NULL default '',
+ timestamp int(11) NOT NULL default '0'
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {history} (
+ uid int(10) NOT NULL default '0',
+ nid int(10) NOT NULL default '0',
+ timestamp int(11) NOT NULL default '0',
+ PRIMARY KEY (uid,nid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {menu} (
+ mid int(10) unsigned NOT NULL default '0',
+ pid int(10) unsigned NOT NULL default '0',
+ path varchar(255) NOT NULL default '',
+ title varchar(255) NOT NULL default '',
+ description varchar(255) NOT NULL default '',
+ weight tinyint(4) NOT NULL default '0',
+ type int(2) unsigned NOT NULL default '0',
+ PRIMARY KEY (mid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+
+ db_query("CREATE TABLE {node} (
+ nid int(10) unsigned NOT NULL auto_increment,
+ vid int(10) unsigned NOT NULL default '0',
+ type varchar(32) NOT NULL default '',
+ title varchar(128) NOT NULL default '',
+ uid int(10) NOT NULL default '0',
+ status int(4) NOT NULL default '1',
+ created int(11) NOT NULL default '0',
+ changed int(11) NOT NULL default '0',
+ comment int(2) NOT NULL default '0',
+ promote int(2) NOT NULL default '0',
+ moderate int(2) NOT NULL default '0',
+ sticky int(2) NOT NULL default '0',
+ PRIMARY KEY (nid, vid),
+ UNIQUE KEY vid (vid),
+ KEY node_type (type(4)),
+ KEY node_title_type (title, type(4)),
+ KEY status (status),
+ KEY uid (uid),
+ KEY node_moderate (moderate),
+ KEY node_promote_status (promote, status),
+ KEY node_created (created),
+ KEY node_changed (changed),
+ KEY node_status_type (status, type, nid),
+ KEY nid (nid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {node_access} (
+ nid int(10) unsigned NOT NULL default '0',
+ gid int(10) unsigned NOT NULL default '0',
+ realm varchar(255) NOT NULL default '',
+ grant_view tinyint(1) unsigned NOT NULL default '0',
+ grant_update tinyint(1) unsigned NOT NULL default '0',
+ grant_delete tinyint(1) unsigned NOT NULL default '0',
+ PRIMARY KEY (nid,gid,realm)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {node_revisions} (
+ nid int(10) unsigned NOT NULL,
+ vid int(10) unsigned NOT NULL,
+ uid int(10) NOT NULL default '0',
+ title varchar(128) NOT NULL default '',
+ body longtext NOT NULL default '',
+ teaser longtext NOT NULL default '',
+ log longtext NOT NULL default '',
+ timestamp int(11) NOT NULL default '0',
+ format int(4) NOT NULL default '0',
+ PRIMARY KEY (vid),
+ KEY nid (nid),
+ KEY uid (uid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {url_alias} (
+ pid int(10) unsigned NOT NULL auto_increment,
+ src varchar(128) NOT NULL default '',
+ dst varchar(128) NOT NULL default '',
+ PRIMARY KEY (pid),
+ UNIQUE KEY dst (dst),
+ KEY src (src)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {permission} (
+ rid int(10) unsigned NOT NULL default '0',
+ perm longtext,
+ tid int(10) unsigned NOT NULL default '0',
+ KEY rid (rid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {role} (
+ rid int(10) unsigned NOT NULL auto_increment,
+ name varchar(32) NOT NULL default '',
+ PRIMARY KEY (rid),
+ UNIQUE KEY name (name)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {blocks_roles} (
+ module varchar(64) NOT NULL,
+ delta varchar(32) NOT NULL,
+ rid int(10) unsigned NOT NULL,
+ PRIMARY KEY (module, delta, rid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {sessions} (
+ uid int(10) unsigned NOT NULL,
+ sid varchar(32) NOT NULL default '',
+ hostname varchar(128) NOT NULL default '',
+ timestamp int(11) NOT NULL default '0',
+ cache int(11) NOT NULL default '0',
+ session longtext,
+ KEY uid (uid),
+ PRIMARY KEY (sid),
+ KEY timestamp (timestamp)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {sequences} (
+ name varchar(255) NOT NULL default '',
+ id int(10) unsigned NOT NULL default '0',
+ PRIMARY KEY (name)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {node_counter} (
+ nid int(10) NOT NULL default '0',
+ totalcount bigint(20) unsigned NOT NULL default '0',
+ daycount mediumint(8) unsigned NOT NULL default '0',
+ timestamp int(11) unsigned NOT NULL default '0',
+ PRIMARY KEY (nid),
+ KEY totalcount (totalcount),
+ KEY daycount (daycount),
+ KEY timestamp (timestamp)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {system} (
+ filename varchar(255) NOT NULL default '',
+ name varchar(255) NOT NULL default '',
+ type varchar(255) NOT NULL default '',
+ description varchar(255) NOT NULL default '',
+ status int(2) NOT NULL default '0',
+ throttle tinyint(1) DEFAULT '0' NOT NULL,
+ bootstrap int(2) NOT NULL default '0',
+ schema_version smallint(3) NOT NULL default -1,
+ weight int(2) NOT NULL default '0',
+ PRIMARY KEY (filename),
+ KEY (weight)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {term_data} (
+ tid int(10) unsigned NOT NULL auto_increment,
+ vid int(10) unsigned NOT NULL default '0',
+ name varchar(255) NOT NULL default '',
+ description longtext,
+ weight tinyint(4) NOT NULL default '0',
+ PRIMARY KEY (tid),
+ KEY vid (vid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {term_hierarchy} (
+ tid int(10) unsigned NOT NULL default '0',
+ parent int(10) unsigned NOT NULL default '0',
+ KEY tid (tid),
+ KEY parent (parent),
+ PRIMARY KEY (tid, parent)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {term_node} (
+ nid int(10) unsigned NOT NULL default '0',
+ tid int(10) unsigned NOT NULL default '0',
+ KEY nid (nid),
+ KEY tid (tid),
+ PRIMARY KEY (tid,nid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {term_relation} (
+ tid1 int(10) unsigned NOT NULL default '0',
+ tid2 int(10) unsigned NOT NULL default '0',
+ KEY tid1 (tid1),
+ KEY tid2 (tid2)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {term_synonym} (
+ tid int(10) unsigned NOT NULL default '0',
+ name varchar(255) NOT NULL default '',
+ KEY tid (tid),
+ KEY name (name(3))
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {users} (
+ uid int(10) unsigned NOT NULL default '0',
+ name varchar(60) NOT NULL default '',
+ pass varchar(32) NOT NULL default '',
+ mail varchar(64) default '',
+ mode tinyint(1) NOT NULL default '0',
+ sort tinyint(1) default '0',
+ threshold tinyint(1) default '0',
+ theme varchar(255) NOT NULL default '',
+ signature varchar(255) NOT NULL default '',
+ created int(11) NOT NULL default '0',
+ access int(11) NOT NULL default '0',
+ login int(11) NOT NULL default '0',
+ status tinyint(4) NOT NULL default '0',
+ timezone varchar(8) default NULL,
+ language varchar(12) NOT NULL default '',
+ picture varchar(255) NOT NULL DEFAULT '',
+ init varchar(64) default '',
+ data longtext,
+ PRIMARY KEY (uid),
+ UNIQUE KEY name (name),
+ KEY access (access)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {users_roles} (
+ uid int(10) unsigned NOT NULL default '0',
+ rid int(10) unsigned NOT NULL default '0',
+ PRIMARY KEY (uid, rid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {variable} (
+ name varchar(48) NOT NULL default '',
+ value longtext NOT NULL,
+ PRIMARY KEY (name)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {vocabulary} (
+ vid int(10) unsigned NOT NULL auto_increment,
+ name varchar(255) NOT NULL default '',
+ description longtext,
+ help varchar(255) NOT NULL default '',
+ relations tinyint(3) unsigned NOT NULL default '0',
+ hierarchy tinyint(3) unsigned NOT NULL default '0',
+ multiple tinyint(3) unsigned NOT NULL default '0',
+ required tinyint(3) unsigned NOT NULL default '0',
+ tags tinyint(3) unsigned NOT NULL default '0',
+ module varchar(255) NOT NULL default '',
+ weight tinyint(4) NOT NULL default '0',
+ PRIMARY KEY (vid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {vocabulary_node_types} (
+ vid int(10) unsigned NOT NULL DEFAULT '0',
+ type varchar(32) NOT NULL DEFAULT '',
+ PRIMARY KEY (vid, type)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ db_query("CREATE TABLE {watchdog} (
+ wid int(5) NOT NULL auto_increment,
+ uid int(10) NOT NULL default '0',
+ type varchar(16) NOT NULL default '',
+ message longtext NOT NULL,
+ severity tinyint(3) unsigned NOT NULL default '0',
+ link varchar(255) NOT NULL default '',
+ location varchar(128) NOT NULL default '',
+ referer varchar(128) NOT NULL default '',
+ hostname varchar(128) NOT NULL default '',
+ timestamp int(11) NOT NULL default '0',
+ PRIMARY KEY (wid)
+ ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
+
+ break;
+ case 'pgsql':
+ break;
+
+ }
+ db_query("INSERT INTO {system} (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('themes/engines/phptemplate/phptemplate.engine', 'phptemplate', 'theme_engine', '', 1, 0, 0, 0)");
+ db_query("INSERT INTO {system} (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('themes/bluemarine/page.tpl.php', 'bluemarine', 'theme', 'themes/engines/phptemplate/phptemplate.engine', 1, 0, 0, 0)");
+
+ db_query("INSERT INTO {users} (uid,name,mail) VALUES(0,'','')");
+
+ db_query("INSERT INTO {role} (name) VALUES ('anonymous user')");
+ db_query("INSERT INTO {role} (name) VALUES ('authenticated user')");
+
+ db_query("INSERT INTO {permission} VALUES (1,'access content',0)");
+ db_query("INSERT INTO {permission} VALUES (2,'access comments, access content, post comments, post comments without approval',0)");
+
+ db_query("INSERT INTO {variable} (name,value) VALUES('theme_default', 's:10:\"bluemarine\";')");
+
+ db_query("INSERT INTO {blocks} (module,delta,theme,status) VALUES('user', 0, 'bluemarine', 1)");
+ db_query("INSERT INTO {blocks} (module,delta,theme,status) VALUES('user', 1, 'bluemarine', 1)");
+
+ db_query("INSERT INTO {node_access} VALUES (0, 0, 'all', 1, 0, 0)");
+
+ db_query("INSERT INTO {filter_formats} (name, roles, cache) VALUES ('Filtered HTML',',1,2,',1)");
+ db_query("INSERT INTO {filter_formats} (name, roles, cache) VALUES ('PHP code','',0)");
+ db_query("INSERT INTO {filter_formats} (name, roles, cache) VALUES ('Full HTML','',1)");
+ db_query("INSERT INTO {filters} VALUES (1,'filter',0,0)");
+ db_query("INSERT INTO {filters} VALUES (1,'filter',2,1)");
+ db_query("INSERT INTO {filters} VALUES (2,'filter',1,0)");
+ db_query("INSERT INTO {filters} VALUES (3,'filter',2,0)");
+ db_query("INSERT INTO {variable} (name,value) VALUES ('filter_html_1','i:1;')");
+
+ db_query("INSERT INTO {variable} (name, value) VALUES ('node_options_forum', 'a:1:{i:0;s:6:\"status\";}')");
+
+ db_query("INSERT INTO {menu} (pid, path, title, description, weight, type) VALUES (0, '', 'Primary links', '', 0, 115)");
+ db_query("INSERT INTO {variable} VALUES ('menu_primary_menu', 'i:2;')");
+ db_query("INSERT INTO {variable} VALUES ('menu_secondary_menu', 'i:2;')");
+}
+
+// Updates for core
function system_update_110() {
$ret = array();
diff --git a/profiles/default.profile b/profiles/default.profile
new file mode 100644
index 0000000..2c93636
--- /dev/null
+++ b/profiles/default.profile
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * Return an array of the modules to be enabled when this profile is installed.
+ *
+ * @return
+ * An array of modules to be enabled.
+ */
+function default_profile_modules() {
+ return array('block', 'comment', 'filter', 'help', 'menu', 'node', 'page', 'story', 'system', 'taxonomy', 'user', 'watchdog');
+}
+
+/**
+ * Return a description of the profile.
+ */
+function default_profile_details() {
+ return array(
+ 'name' => 'Drupal',
+ 'description' => 'Select this profile to enable some basic Drupal functionality and the default theme.'
+ );
+}
diff --git a/update.php b/update.php
index 7390b27..32d81be 100644
--- a/update.php
+++ b/update.php
@@ -363,13 +363,14 @@ function update_selection_page() {
function update_update_page() {
// Set the installed version so updates start at the correct place.
- $_SESSION['update_remaining'] = array();
+ // Ensure system.module's updates are run first by making it the first element.
+ $_SESSION['update_remaining'] = array('system' => '');
foreach ($_POST['edit']['start'] as $module => $version) {
drupal_set_installed_schema_version($module, $version - 1);
$max_version = max(drupal_get_schema_versions($module));
if ($version <= $max_version) {
foreach (range($version, $max_version) as $update) {
- $_SESSION['update_remaining'][] = array('module' => $module, 'version' => $update);
+ $_SESSION['update_remaining'][$module] = array('module' => $module, 'version' => $update);
}
}
}
@@ -676,6 +677,7 @@ ini_set('display_errors', TRUE);
// Access check:
if (($access_check == FALSE) || ($user->uid == 1)) {
+ $install = FALSE;
include_once './includes/install.inc';
update_fix_schema_version();