Commit 1c75a210 authored by Dries's avatar Dries

- Patch #68926 by chx, jeremy, steven, eaton, webchick, amazon, neil, nedjo et...

- Patch #68926 by chx, jeremy, steven, eaton, webchick, amazon, neil, nedjo et al: an initial install system for Drupal core.
parent e4e416d1
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -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();
}
/**
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
This diff is collapsed.
<?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;
}
?>
<?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;
}
?>
......@@ -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;
}
}
}
}
......
......@@ -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;
}
/**
......
This diff is collapsed.
......@@ -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 */
......
<?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;
}
}
<?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
<?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
<?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
<?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
<?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),