? files ? install_form.patch ? install_form_7_0.patch ? no_settings_php.patch ? no_settings_php_0.patch ? tplify_theme.inc.patch ? sites/logrus.com ? sites/all/modules Index: CHANGELOG.txt =================================================================== RCS file: /cvs/drupal/drupal/CHANGELOG.txt,v retrieving revision 1.194 diff -u -p -r1.194 CHANGELOG.txt --- CHANGELOG.txt 7 May 2007 12:29:20 -0000 1.194 +++ CHANGELOG.txt 8 May 2007 06:35:15 -0000 @@ -25,10 +25,12 @@ Drupal 6.0, xxxx-xx-xx (development vers * Improved handling of teasers in posts. * Added sticky table headers. * Check for clean URL support automatically with JavaScript. + * Removed default/settings.php. Instead the installer will create it from default.settings.php. - Theme system: * Added .info files to themes and made it easier to specify regions and features. * Added theme registry: modules can directly provide .tpl.php files for their themes without having to create theme_ functions. * Used the Garland theme for the installation and maintenance pages. + * Added theme preprocess functions for themes that are templates - Refactored update.php to a generic batch API to be able to run time consuming operations in multiple subsequent HTTP requests Drupal 5.0, 2007-01-15 Index: install.php =================================================================== RCS file: /cvs/drupal/drupal/install.php,v retrieving revision 1.42 diff -u -p -r1.42 install.php --- install.php 6 May 2007 11:56:41 -0000 1.42 +++ install.php 8 May 2007 06:35:16 -0000 @@ -114,7 +114,7 @@ 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') { + if ($_SERVER['REQUEST_METHOD'] == 'GET' && !empty($db_url)) { // We need this because we want to run form_get_errors. include_once './includes/form.inc'; @@ -146,7 +146,8 @@ function install_change_settings($profil $db_host = urldecode($url['host']); $db_port = isset($url['port']) ? urldecode($url['port']) : ''; $db_path = ltrim(urldecode($url['path']), '/'); - $settings_file = './'. conf_path() .'/settings.php'; + $conf_path = './'. conf_path(); + $settings_file = $conf_path .'/settings.php'; // We always need this because we want to run form_get_errors. include_once './includes/form.inc'; @@ -155,18 +156,30 @@ function install_change_settings($profil // 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_set_message(st('The @drupal installer requires write permissions to %file during the installation process.', array('@drupal' => drupal_install_profile_name(), '%file' => $settings_file)), 'error'); + $writeable = FALSE; + $file = $conf_path; + // Verify the directory exists. + if (drupal_verify_install_file($conf_path, FILE_EXIST, 'dir')) { + // Check to see if a settings.php already exists + if (drupal_verify_install_file($settings_file, FILE_EXIST)) { + // If it does, make sure it is writeable + $writeable = drupal_verify_install_file($settings_file, FILE_READABLE|FILE_WRITEABLE); + $file = $settings_file; + } + else { + // If not, makes sure the directory is. + $writeable = drupal_verify_install_file($conf_path, FILE_READABLE|FILE_WRITEABLE, 'dir'); + } + } + + if (!$writeable) { + drupal_set_message(st('The @drupal installer requires write permissions to %file during the installation process.', array('@drupal' => drupal_install_profile_name(), '%file' => $file)), 'error'); drupal_set_title(st('Drupal database setup')); print theme('install_page', ''); exit; } - // Don't fill in placeholders - if ($db_url == 'mysql://username:password@localhost/databasename') { - $db_user = $db_pass = $db_path = ''; - } $output = drupal_get_form('install_settings_form', $profile, $install_locale, $settings_file, $db_url, $db_type, $db_prefix, $db_user, $db_pass, $db_host, $db_port, $db_path); drupal_set_title(st('Database configuration')); print theme('install_page', $output); @@ -178,6 +191,9 @@ function install_change_settings($profil * Form API array definition for install_settings. */ function install_settings_form($profile, $install_locale, $settings_file, $db_url, $db_type, $db_prefix, $db_user, $db_pass, $db_host, $db_port, $db_path) { + if (empty($db_host)) { + $db_host = 'localhost'; + } $db_types = drupal_detect_database_types(); if (count($db_types) == 0) { $form['no_db_types'] = array( @@ -311,11 +327,6 @@ function install_settings_form_validate( function _install_settings_form_validate($db_prefix, $db_type, $db_user, $db_pass, $db_host, $db_port, $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 the table prefix if (!empty($db_prefix) && is_string($db_prefix) && !preg_match('/^[A-Za-z0-9_.]+$/', $db_prefix)) { form_set_error('db_prefix', st('The database table prefix you have entered, %db_prefix, is invalid. The table prefix can only contain alphanumeric characters, underscores or dots.', array('%db_prefix' => $db_prefix)), 'error'); Index: includes/bootstrap.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v retrieving revision 1.164 diff -u -p -r1.164 bootstrap.inc --- includes/bootstrap.inc 6 May 2007 05:47:51 -0000 1.164 +++ includes/bootstrap.inc 8 May 2007 06:35:17 -0000 @@ -266,7 +266,9 @@ function conf_init() { global $db_url, $db_prefix, $cookie_domain, $conf, $installed_profile; $conf = array(); - include_once './'. conf_path() .'/settings.php'; + if (file_exists('./'. conf_path() .'/settings.php')) { + include_once './'. conf_path() .'/settings.php'; + } if (isset($base_url)) { // Parse fixed base URL from settings.php. Index: includes/database.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/database.inc,v retrieving revision 1.67 diff -u -p -r1.67 database.inc --- includes/database.inc 13 Apr 2007 08:56:57 -0000 1.67 +++ includes/database.inc 8 May 2007 06:35:17 -0000 @@ -102,6 +102,11 @@ function db_set_active($name = 'default' global $db_url, $db_type, $active_db; static $db_conns; + if (empty($db_url)) { + include_once 'includes/install.inc'; + install_goto('install.php'); + } + if (!isset($db_conns[$name])) { // Initiate a new connection, using the named DB URL specified. if (is_array($db_url)) { Index: includes/database.mysql.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/database.mysql.inc,v retrieving revision 1.70 diff -u -p -r1.70 database.mysql.inc --- includes/database.mysql.inc 21 Apr 2007 18:08:41 -0000 1.70 +++ includes/database.mysql.inc 8 May 2007 06:35:17 -0000 @@ -57,11 +57,6 @@ function db_connect($url) { // Check if MySQL support is present in PHP if (!function_exists('mysql_connect')) { - // Redirect to installer if using default DB credentials - if ($url['user'] == 'username' && $url['pass'] == 'password') { - include_once 'includes/install.inc'; - install_goto('install.php'); - } drupal_maintenance_theme(); drupal_set_title('PHP MySQL support not enabled'); print theme('maintenance_page', '

We were unable to use the MySQL database because the MySQL extension for PHP is not installed. Check your PHP.ini to see how you can enable it.

@@ -94,12 +89,6 @@ function db_connect($url) { // (matched) rows, not the number of affected rows. $connection = @mysql_connect($url['host'], $url['user'], $url['pass'], TRUE, 2); if (!$connection) { - // Redirect to installer if using default DB credentials - if ($url['user'] == 'username' && $url['pass'] == 'password') { - include_once 'includes/install.inc'; - install_goto('install.php'); - } - // Show error screen otherwise drupal_maintenance_theme(); drupal_set_header('HTTP/1.1 503 Service Unavailable'); Index: includes/install.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/install.inc,v retrieving revision 1.37 diff -u -p -r1.37 install.inc --- includes/install.inc 17 Apr 2007 07:19:38 -0000 1.37 +++ includes/install.inc 8 May 2007 06:35:18 -0000 @@ -165,8 +165,9 @@ function drupal_detect_database_types() * An array of settings that need to be updated. */ function drupal_rewrite_settings($settings = array(), $prefix = '') { + $default_settings = './sites/default/default.settings.php'; $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) { @@ -176,7 +177,7 @@ function drupal_rewrite_settings($settin $buffer = NULL; $first = TRUE; - if ($fp = @fopen($settings_file, 'r+')) { + if ($fp = fopen($default_settings, 'r')) { // Step line by line through settings.php. while (!feof($fp)) { $line = fgets($fp); Index: sites/default/default.settings.php =================================================================== RCS file: sites/default/default.settings.php diff -N sites/default/default.settings.php --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sites/default/default.settings.php 8 May 2007 06:35:18 -0000 @@ -0,0 +1,179 @@ + 'main_', + * 'users' => 'shared_', + * 'sessions' => 'shared_', + * 'role' => 'shared_', + * 'authmap' => 'shared_', + * 'sequences' => 'shared_', + * ); + * + * Database URL format: + * $db_url = 'mysql://username:password@localhost/databasename'; + * $db_url = 'mysqli://username:password@localhost/databasename'; + * $db_url = 'pgsql://username:password@localhost/databasename'; + */ +$db_url = 'mysql://username:password@localhost/databasename'; +$db_prefix = ''; + +/** + * Base URL (optional). + * + * If you are experiencing issues with different site domains, + * uncomment the Base URL statement below (remove the leading hash sign) + * and fill in the URL to your Drupal installation. + * + * You might also want to force users to use a given domain. + * See the .htaccess file for more information. + * + * Examples: + * $base_url = 'http://www.example.com'; + * $base_url = 'http://www.example.com:8888'; + * $base_url = 'http://www.example.com/drupal'; + * $base_url = 'https://www.example.com:8888/drupal'; + * + * It is not allowed to have a trailing slash; Drupal will add it + * for you. + */ +# $base_url = 'http://www.example.com'; // NO trailing slash! + +/** + * PHP settings: + * + * To see what PHP settings are possible, including whether they can + * be set at runtime (ie., when ini_set() occurs), read the PHP + * documentation at http://www.php.net/manual/en/ini.php#ini.list + * and take a look at the .htaccess file to see which non-runtime + * settings are used there. Settings defined here should not be + * duplicated there so as to avoid conflict issues. + */ +ini_set('arg_separator.output', '&'); +ini_set('magic_quotes_runtime', 0); +ini_set('magic_quotes_sybase', 0); +ini_set('session.cache_expire', 200000); +ini_set('session.cache_limiter', 'none'); +ini_set('session.cookie_lifetime', 2000000); +ini_set('session.gc_maxlifetime', 200000); +ini_set('session.save_handler', 'user'); +ini_set('session.use_only_cookies', 1); +ini_set('session.use_trans_sid', 0); +ini_set('url_rewriter.tags', ''); + +/** + * Drupal automatically generates a unique session cookie name for each site + * based on on its full domain name. If you have multiple domains pointing at + * the same Drupal site, you can either redirect them all to a single + * domain (see comment in .htaccess), or uncomment the line below and specify + * their shared base domain. Doing so assures that users remain logged in as they + * cross between your various domains. +*/ + +#$cookie_domain = 'example.com'; + +/** + * Variable overrides: + * + * To override specific entries in the 'variable' table for this site, + * set them here. You usually don't need to use this feature. This is + * useful in a configuration file for a vhost or directory, rather than + * the default settings.php. Any configuration setting from the 'variable' + * table can be given a new value. + * + * Remove the leading hash signs to enable. + */ +# $conf = array( +# 'site_name' => 'My Drupal site', +# 'theme_default' => 'minnelli', +# 'anonymous' => 'Visitor', +# ); + +/** + * String overrides: + * + * To override specific strings on your site with or without enabling locale + * module, add an entry to this list. This functionality allows you to change + * a small number of your site's default English language interface strings. + * + * Remove the leading hash signs to enable. + */ +# $conf['locale_custom_strings_en'] = array( +# 'forum' => 'Discussion board', +# '@count min' => '@count minutes', +# ); Index: sites/default/settings.php =================================================================== RCS file: sites/default/settings.php diff -N sites/default/settings.php --- sites/default/settings.php 4 May 2007 08:32:00 -0000 1.56 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,179 +0,0 @@ - 'main_', - * 'users' => 'shared_', - * 'sessions' => 'shared_', - * 'role' => 'shared_', - * 'authmap' => 'shared_', - * 'sequences' => 'shared_', - * ); - * - * Database URL format: - * $db_url = 'mysql://username:password@localhost/databasename'; - * $db_url = 'mysqli://username:password@localhost/databasename'; - * $db_url = 'pgsql://username:password@localhost/databasename'; - */ -$db_url = 'mysql://username:password@localhost/databasename'; -$db_prefix = ''; - -/** - * Base URL (optional). - * - * If you are experiencing issues with different site domains, - * uncomment the Base URL statement below (remove the leading hash sign) - * and fill in the URL to your Drupal installation. - * - * You might also want to force users to use a given domain. - * See the .htaccess file for more information. - * - * Examples: - * $base_url = 'http://www.example.com'; - * $base_url = 'http://www.example.com:8888'; - * $base_url = 'http://www.example.com/drupal'; - * $base_url = 'https://www.example.com:8888/drupal'; - * - * It is not allowed to have a trailing slash; Drupal will add it - * for you. - */ -# $base_url = 'http://www.example.com'; // NO trailing slash! - -/** - * PHP settings: - * - * To see what PHP settings are possible, including whether they can - * be set at runtime (ie., when ini_set() occurs), read the PHP - * documentation at http://www.php.net/manual/en/ini.php#ini.list - * and take a look at the .htaccess file to see which non-runtime - * settings are used there. Settings defined here should not be - * duplicated there so as to avoid conflict issues. - */ -ini_set('arg_separator.output', '&'); -ini_set('magic_quotes_runtime', 0); -ini_set('magic_quotes_sybase', 0); -ini_set('session.cache_expire', 200000); -ini_set('session.cache_limiter', 'none'); -ini_set('session.cookie_lifetime', 2000000); -ini_set('session.gc_maxlifetime', 200000); -ini_set('session.save_handler', 'user'); -ini_set('session.use_only_cookies', 1); -ini_set('session.use_trans_sid', 0); -ini_set('url_rewriter.tags', ''); - -/** - * Drupal automatically generates a unique session cookie name for each site - * based on on its full domain name. If you have multiple domains pointing at - * the same Drupal site, you can either redirect them all to a single - * domain (see comment in .htaccess), or uncomment the line below and specify - * their shared base domain. Doing so assures that users remain logged in as they - * cross between your various domains. -*/ - -#$cookie_domain = 'example.com'; - -/** - * Variable overrides: - * - * To override specific entries in the 'variable' table for this site, - * set them here. You usually don't need to use this feature. This is - * useful in a configuration file for a vhost or directory, rather than - * the default settings.php. Any configuration setting from the 'variable' - * table can be given a new value. - * - * Remove the leading hash signs to enable. - */ -# $conf = array( -# 'site_name' => 'My Drupal site', -# 'theme_default' => 'minnelli', -# 'anonymous' => 'Visitor', -# ); - -/** - * String overrides: - * - * To override specific strings on your site with or without enabling locale - * module, add an entry to this list. This functionality allows you to change - * a small number of your site's default English language interface strings. - * - * Remove the leading hash signs to enable. - */ -# $conf['locale_custom_strings_en'] = array( -# 'forum' => 'Discussion board', -# '@count min' => '@count minutes', -# );