install_change_settings
./install.php, строка 140
- Версии
- 5 – 6
install_change_settings($profile = 'default', $install_locale = '')
Configure and rewrite settings.php.
Код
<?php
function install_change_settings($profile = 'default', $install_locale = '') {
global $db_url, $db_type, $db_prefix;
$url = parse_url(is_array($db_url) ? $db_url['default'] : $db_url);
$db_user = urldecode($url['user']);
$db_pass = urldecode($url['pass']);
$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';
// We always need this because we want to run form_get_errors.
include_once './includes/form.inc';
drupal_maintenance_theme();
// Don't fill in placeholders
if ($db_url == 'mysql://username:password@localhost/databasename') {
$db_user = $db_pass = $db_path = '';
}
elseif (!empty($db_url)) {
// Do not install over a configured settings.php.
install_already_done_error();
}
// 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');
drupal_set_title(st('Drupal database setup'));
print theme('install_page', '');
exit;
}
$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);
exit;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии