Index: install.php =================================================================== RCS file: /cvs/drupal/drupal/install.php,v retrieving revision 1.116 diff -u -p -r1.116 install.php --- install.php 10 Feb 2008 19:03:47 -0000 1.116 +++ install.php 11 Apr 2008 16:16:59 -0000 @@ -159,7 +159,7 @@ function install_verify_settings() { $db_host = urldecode($url['host']); $db_port = isset($url['port']) ? urldecode($url['port']) : ''; $db_path = ltrim(urldecode($url['path']), '/'); - $settings_file = './'. conf_path(FALSE, TRUE) .'/settings.php'; + $settings_file = './' . conf_path(FALSE, TRUE) . '/settings.php'; $form_state = array(); _install_settings_form_validate($db_prefix, $db_type, $db_user, $db_pass, $db_host, $db_port, $db_path, $settings_file, $form_state); @@ -182,8 +182,8 @@ function install_change_settings($profil $db_host = isset($url['host']) ? urldecode($url['host']) : ''; $db_port = isset($url['port']) ? urldecode($url['port']) : ''; $db_path = ltrim(urldecode($url['path']), '/'); - $conf_path = './'. conf_path(FALSE, TRUE); - $settings_file = $conf_path .'/settings.php'; + $conf_path = './' . conf_path(FALSE, TRUE); + $settings_file = $conf_path . '/settings.php'; // We always need this because we want to run form_get_errors. include_once './includes/form.inc'; @@ -227,7 +227,7 @@ function install_settings_form(&$form_st $form['basic_options'] = array( '#type' => 'fieldset', '#title' => st('Basic options'), - '#description' => '

'. st('To set up your @drupal database, enter the following information.', array('@drupal' => drupal_install_profile_name())) .'

', + '#description' => '

' . st('To set up your @drupal database, enter the following information.', array('@drupal' => drupal_install_profile_name())) . '

', ); if (count($db_types) > 1) { @@ -312,7 +312,7 @@ function install_settings_form(&$form_st ); // Table prefix - $prefix = ($profile == 'default') ? 'drupal_' : $profile .'_'; + $prefix = ($profile == 'default') ? 'drupal_' : $profile . '_'; $form['advanced_options']['db_prefix'] = array( '#type' => 'textfield', '#title' => st('Table prefix'), @@ -330,7 +330,7 @@ function install_settings_form(&$form_st $form['errors'] = array(); $form['settings_file'] = array('#type' => 'value', '#value' => $settings_file); $form['_db_url'] = array('#type' => 'value'); - $form['#action'] = "install.php?profile=$profile". ($install_locale ? "&locale=$install_locale" : ''); + $form['#action'] = "install.php?profile=$profile" . ($install_locale ? "&locale=$install_locale" : ''); $form['#redirect'] = FALSE; } return $form; @@ -370,13 +370,13 @@ function _install_settings_form_validate } else { // Verify - $db_url = $db_type .'://'. urlencode($db_user) . ($db_pass ? ':'. urlencode($db_pass) : '') .'@'. ($db_host ? urlencode($db_host) : 'localhost') . ($db_port ? ":$db_port" : '') .'/'. urlencode($db_path); + $db_url = $db_type . '://' . urlencode($db_user) . ($db_pass ? ':' . urlencode($db_pass) : '') . '@' . ($db_host ? urlencode($db_host) : 'localhost') . ($db_port ? ":$db_port" : '') . '/' . urlencode($db_path); if (isset($form)) { form_set_value($form['_db_url'], $db_url, $form_state); } $success = array(); - $function = 'drupal_test_'. $db_type; + $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 continue 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 Installation and upgrading handbook. If you are unsure what any of this means you should probably contact your hosting provider.', array('%commands' => implode($success, ', ')))); @@ -406,7 +406,7 @@ function install_settings_form_submit($f drupal_rewrite_settings($settings); // Continue to install profile step - install_goto("install.php?profile=$profile". ($install_locale ? "&locale=$install_locale" : '')); + install_goto("install.php?profile=$profile" . ($install_locale ? "&locale=$install_locale" : '')); } /** @@ -454,7 +454,7 @@ function install_select_profile_form(&$f foreach ($profiles as $profile) { include_once($profile->filename); // Load profile details. - $function = $profile->name .'_profile_details'; + $function = $profile->name . '_profile_details'; if (function_exists($function)) { $details = $function(); } @@ -480,7 +480,7 @@ function install_select_profile_form(&$f * Find all .po files for the current profile. */ function install_find_locales($profilename) { - $locales = file_scan_directory('./profiles/'. $profilename .'/translations', '\.po$', array('.', '..', 'CVS'), 0, FALSE); + $locales = file_scan_directory('./profiles/' . $profilename . '/translations', '\.po$', array('.', '..', 'CVS'), 0, FALSE); array_unshift($locales, (object) array('name' => 'en')); return $locales; } @@ -507,16 +507,16 @@ function install_select_locale($profilen install_task_list('locale-select'); drupal_set_title(st('Choose language')); if (!empty($_GET['localize'])) { - $output = '

'. st('With the addition of an appropriate translation package, this installer is capable of proceeding in another language of your choice. To install and use Drupal in a language other than English:') .'

'; - $output .= '

'. st('Alternatively, to install and use Drupal in English, or to defer the selection of an alternative language until after installation, select the first link below.') .'

'; - $output .= '

'. st('How should the installation continue?') .'

'; - $output .= ''; + $output = '

' . st('With the addition of an appropriate translation package, this installer is capable of proceeding in another language of your choice. To install and use Drupal in a language other than English:') . '

'; + $output .= '

' . st('Alternatively, to install and use Drupal in English, or to defer the selection of an alternative language until after installation, select the first link below.') . '

'; + $output .= '

' . st('How should the installation continue?') . '

'; + $output .= ''; } else { - $output = ''; + $output = ''; } print theme('install_page', $output); exit; @@ -527,7 +527,7 @@ function install_select_locale($profilen } else { // Allow profile to pre-select the language, skipping the selection. - $function = $profilename .'_profile_details'; + $function = $profilename . '_profile_details'; if (function_exists($function)) { $details = $function(); if (isset($details['language'])) { @@ -563,13 +563,13 @@ function install_select_locale_form(&$fo // Try to use verbose locale name $name = $locale->name; if (isset($languages[$name])) { - $name = $languages[$name][0] . (isset($languages[$name][1]) ? ' '. st('(@language)', array('@language' => $languages[$name][1])) : ''); + $name = $languages[$name][0] . (isset($languages[$name][1]) ? ' ' . st('(@language)', array('@language' => $languages[$name][1])) : ''); } $form['locale'][$locale->name] = array( '#type' => 'radio', '#return_value' => $locale->name, '#default_value' => ($locale->name == 'en' ? TRUE : FALSE), - '#title' => $name . ($locale->name == 'en' ? ' '. st('(built-in)') : ''), + '#title' => $name . ($locale->name == 'en' ? ' ' . st('(built-in)') : ''), '#parents' => array('locale') ); } @@ -586,7 +586,7 @@ function install_select_locale_form(&$fo function install_no_profile_error() { install_task_list('profile-select'); drupal_set_title(st('No profiles available')); - print theme('install_page', '

'. st('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.') .'

'); + print theme('install_page', '

' . st('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.') . '

'); exit; } @@ -614,7 +614,7 @@ function install_tasks($profile, $task) $_SESSION['messages'] = $messages; // URL used to direct page requests. - $url = $base_url .'/install.php?locale='. $install_locale .'&profile='. $profile; + $url = $base_url . '/install.php?locale=' . $install_locale . '&profile=' . $profile; // Build a page for final tasks. if (empty($task)) { @@ -697,8 +697,8 @@ function install_tasks($profile, $task) drupal_set_title(st('Configure site')); // Warn about settings.php permissions risk - $settings_dir = './'. conf_path(); - $settings_file = $settings_dir .'/settings.php'; + $settings_dir = './' . conf_path(); + $settings_file = $settings_dir . '/settings.php'; if (!drupal_verify_install_file($settings_file, FILE_EXIST|FILE_READABLE|FILE_NOT_WRITABLE) || !drupal_verify_install_file($settings_dir, FILE_NOT_WRITABLE, 'dir')) { drupal_set_message(st('All necessary changes to %dir and %file have been made, so you should remove write permissions to them now in order to avoid security risks. If you are unsure how to do so, please consult the on-line handbook.', array('%dir' => $settings_dir, '%file' => $settings_file, '@handbook_url' => 'http://drupal.org/getting-started')), 'error'); } @@ -708,7 +708,7 @@ function install_tasks($profile, $task) // Add JavaScript validation. _user_password_dynamic_validation(); - drupal_add_js(drupal_get_path('module', 'system') .'/system.js', 'module'); + drupal_add_js(drupal_get_path('module', 'system') . '/system.js', 'module'); // We add these strings as settings because JavaScript translation does not // work on install time. drupal_add_js(array('copyFieldValue' => array('edit-site-mail' => array('edit-account-mail')), 'cleanURL' => array('success' => st('Your server has been successfully tested to support this feature.'), 'failure' => st('Your system configuration does not currently support this feature. The handbook page on Clean URLs has additional troubleshooting information.'), 'testing' => st('Testing clean URLs...'))), 'setting'); @@ -733,7 +733,7 @@ if (Drupal.jsEnabled) { // reserved for profiles, hand over the control to the profile, // so it can run any number of custom tasks it defines. if (!in_array($task, install_reserved_tasks())) { - $function = $profile .'_profile_tasks'; + $function = $profile . '_profile_tasks'; if (function_exists($function)) { // The profile needs to run more code, maybe even more tasks. // $task is sent through as a reference and may be changed! @@ -778,8 +778,8 @@ if (Drupal.jsEnabled) { if ($task == 'finished') { drupal_set_title(st('@drupal installation complete', array('@drupal' => drupal_install_profile_name()))); $messages = drupal_set_message(); - $output = '

'. st('Congratulations, @drupal has been successfully installed.', array('@drupal' => drupal_install_profile_name())) .'

'; - $output .= '

'. (isset($messages['error']) ? st('Please review the messages above before continuing on to your new site.', array('@url' => url(''))) : st('You may now visit your new site.', array('@url' => url('')))) .'

'; + $output = '

' . st('Congratulations, @drupal has been successfully installed.', array('@drupal' => drupal_install_profile_name())) . '

'; + $output .= '

' . (isset($messages['error']) ? st('Please review the messages above before continuing on to your new site.', array('@url' => url(''))) : st('You may now visit your new site.', array('@url' => url('')))) . '

'; $task = 'done'; } @@ -821,7 +821,7 @@ function _install_module_batch($module, // steps. module_enable(array($module)); $context['results'][] = $module; - $context['message'] = 'Installed '. $module_name .' module.'; + $context['message'] = 'Installed ' . $module_name . ' module.'; } /** @@ -866,8 +866,8 @@ function install_check_requirements($pro // If Drupal is not set up already, we need to create a settings file. if (!$verify) { $writable = FALSE; - $conf_path = './'. conf_path(FALSE, TRUE); - $settings_file = $conf_path .'/settings.php'; + $conf_path = './' . conf_path(FALSE, TRUE); + $settings_file = $conf_path . '/settings.php'; $file = $conf_path; // Verify that the directory exists. if (drupal_verify_install_file($conf_path, FILE_EXIST, 'dir')) { @@ -899,7 +899,7 @@ function install_check_requirements($pro if (isset($requirement['severity']) && $requirement['severity'] == REQUIREMENT_ERROR) { $message = $requirement['description']; if (isset($requirement['value']) && $requirement['value']) { - $message .= ' ('. st('Currently using !item !version', array('!item' => $requirement['title'], '!version' => $requirement['value'])) .')'; + $message .= ' (' . st('Currently using !item !version', array('!item' => $requirement['title'], '!version' => $requirement['value'])) . ')'; } drupal_set_message($message, 'error'); } @@ -911,7 +911,7 @@ function install_check_requirements($pro if (isset($requirement['severity']) && $requirement['severity'] == REQUIREMENT_WARNING) { $message = $requirement['description']; if (isset($requirement['value']) && $requirement['value']) { - $message .= ' ('. st('Currently using !item !version', array('!item' => $requirement['title'], '!version' => $requirement['value'])) .')'; + $message .= ' (' . st('Currently using !item !version', array('!item' => $requirement['title'], '!version' => $requirement['value'])) . ')'; } drupal_set_message($message, 'warning'); } @@ -947,7 +947,7 @@ function install_task_list($active = NUL // Add tasks defined by the profile. if ($profile) { - $function = $profile .'_profile_task_list'; + $function = $profile . '_profile_task_list'; if (function_exists($function)) { $result = $function(); if (is_array($result)) { @@ -1013,7 +1013,7 @@ function install_configure_form(&$form_s ); $form['admin_account']['account']['#tree'] = TRUE; $form['admin_account']['markup'] = array( - '#value' => '

'. st('The administrator account has complete access to the site; it will automatically be granted all permissions and can perform any administrative activity. This will be the only account that can perform certain activities, so keep its credentials safe.') .'

', + '#value' => '

' . st('The administrator account has complete access to the site; it will automatically be granted all permissions and can perform any administrative activity. This will be the only account that can perform certain activities, so keep its credentials safe.') . '

', '#weight' => -10, ); @@ -1085,7 +1085,7 @@ function install_configure_form(&$form_s // Allow the profile to alter this form. $form_state isn't available // here, but to conform to the hook_form_alter() signature, we pass // an empty array. - $hook_form_alter = $_GET['profile'] .'_form_alter'; + $hook_form_alter = $_GET['profile'] . '_form_alter'; if (function_exists($hook_form_alter)) { $hook_form_alter($form, array(), 'install_configure'); } Index: update.php =================================================================== RCS file: /cvs/drupal/drupal/update.php,v retrieving revision 1.253 diff -u -p -r1.253 update.php --- update.php 19 Mar 2008 07:36:28 -0000 1.253 +++ update.php 11 Apr 2008 16:17:00 -0000 @@ -66,15 +66,15 @@ function db_add_column(&$ret, $table, $c } } - $ret[] = update_sql("ALTER TABLE {". $table ."} ADD $column $type"); + $ret[] = update_sql("ALTER TABLE {" . $table . "} ADD $column $type"); if (!empty($default)) { - $ret[] = update_sql("ALTER TABLE {". $table ."} ALTER $column SET $default"); + $ret[] = update_sql("ALTER TABLE {" . $table . "} ALTER $column SET $default"); } if (!empty($not_null)) { if (!empty($default)) { - $ret[] = update_sql("UPDATE {". $table ."} SET $column = $default_val"); + $ret[] = update_sql("UPDATE {" . $table . "} SET $column = $default_val"); } - $ret[] = update_sql("ALTER TABLE {". $table ."} ALTER $column SET NOT NULL"); + $ret[] = update_sql("ALTER TABLE {" . $table . "} ALTER $column SET NOT NULL"); } } @@ -122,16 +122,16 @@ function db_change_column(&$ret, $table, } } - $ret[] = update_sql("ALTER TABLE {". $table ."} RENAME $column TO ". $column ."_old"); - $ret[] = update_sql("ALTER TABLE {". $table ."} ADD $column_new $type"); - $ret[] = update_sql("UPDATE {". $table ."} SET $column_new = ". $column ."_old"); + $ret[] = update_sql("ALTER TABLE {" . $table . "} RENAME $column TO " . $column . "_old"); + $ret[] = update_sql("ALTER TABLE {" . $table . "} ADD $column_new $type"); + $ret[] = update_sql("UPDATE {" . $table . "} SET $column_new = " . $column . "_old"); if ($default) { - $ret[] = update_sql("ALTER TABLE {". $table ."} ALTER $column_new SET $default"); + $ret[] = update_sql("ALTER TABLE {" . $table . "} ALTER $column_new SET $default"); } if ($not_null) { - $ret[] = update_sql("ALTER TABLE {". $table ."} ALTER $column_new SET NOT NULL"); + $ret[] = update_sql("ALTER TABLE {" . $table . "} ALTER $column_new SET NOT NULL"); } - $ret[] = update_sql("ALTER TABLE {". $table ."} DROP ". $column ."_old"); + $ret[] = update_sql("ALTER TABLE {" . $table . "} DROP " . $column . "_old"); } /** @@ -159,7 +159,7 @@ function update_do_one($module, $number, return; } - $function = $module .'_update_'. $number; + $function = $module . '_update_' . $number; if (function_exists($function)) { $ret = $function($context['sandbox']); } @@ -185,7 +185,7 @@ function update_do_one($module, $number, drupal_set_installed_schema_version($module, $number); } - $context['message'] = 'Updating '. check_plain($module) .' module'; + $context['message'] = 'Updating ' . check_plain($module) . ' module'; } function update_selection_page() { @@ -223,7 +223,7 @@ function update_script_selection_form() $last_removed = module_invoke($module, 'update_last_removed'); if ($schema_version < $last_removed) { $form['start'][$module] = array( - '#value' => ''. $module .' module can not be updated. Its schema version is '. $schema_version .'. Updates up to and including '. $last_removed .' have been removed in this release. In order to update '. $module .' module, you will first need to upgrade to the last version in which these updates were available.', + '#value' => '' . $module . ' module can not be updated. Its schema version is ' . $schema_version . '. Updates up to and including ' . $last_removed . ' have been removed in this release. In order to update ' . $module . ' module, you will first need to upgrade to the last version in which these updates were available.', '#prefix' => '
', '#suffix' => '
', ); @@ -241,7 +241,7 @@ function update_script_selection_form() } $form['start'][$module] = array( '#type' => 'select', - '#title' => $module .' module', + '#title' => $module . ' module', '#default_value' => $default, '#options' => $updates, ); @@ -285,7 +285,7 @@ function update_batch() { 'finished' => 'update_finished', ); batch_set($batch); - batch_process($base_url .'/update.php?op=results', $base_url .'/update.php'); + batch_process($base_url . '/update.php?op=results', $base_url . '/update.php'); } function update_finished($success, $results, $operations) { @@ -300,24 +300,24 @@ function update_finished($success, $resu function update_results_page() { drupal_set_title('Drupal database update'); // NOTE: we can't use l() here because the URL would point to 'update.php?q=admin'. - $links[] = 'Main page'; - $links[] = 'Administration pages'; + $links[] = 'Main page'; + $links[] = 'Administration pages'; update_task_list(); // Report end result if (module_exists('dblog')) { - $log_message = ' All errors have been logged.'; + $log_message = ' All errors have been logged.'; } else { $log_message = ' All errors have been logged.'; } if ($_SESSION['update_success']) { - $output = '

Updates were attempted. If you see no failures below, you may proceed happily to the administration pages. Otherwise, you may need to update your database manually.'. $log_message .'

'; + $output = '

Updates were attempted. If you see no failures below, you may proceed happily to the administration pages. Otherwise, you may need to update your database manually.' . $log_message . '

'; } else { list($module, $version) = array_pop(reset($_SESSION['updates_remaining'])); - $output = '

The update process was aborted prematurely while running update #'. $version .' in '. $module .'.module.'. $log_message; + $output = '

The update process was aborted prematurely while running update #' . $version . ' in ' . $module . '.module.' . $log_message; if (module_exists('dblog')) { $output .= ' You may need to check the watchdog database table manually.'; } @@ -335,17 +335,17 @@ function update_results_page() { $output .= '

'; $output .= '

The following queries were executed

'; foreach ($_SESSION['update_results'] as $module => $updates) { - $output .= '

'. $module .' module

'; + $output .= '

' . $module . ' module

'; foreach ($updates as $number => $queries) { if ($number != '#abort') { - $output .= '

Update #'. $number .'

'; + $output .= '

Update #' . $number . '

'; $output .= '