From 56d2664a904119f73e7df4fb355e4c525e040b70 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 14 Apr 2008 17:48:46 +0000 Subject: - Patch #245115 by kkaefer, John Morahan, JohnAlbin et al: after a long discussion we've decided to make the concatenation operator consistent with the other operators. --- update.php | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'update.php') diff --git a/update.php b/update.php index 1db7779a6..c0bf4a38f 100644 --- a/update.php +++ b/update.php @@ -66,15 +66,15 @@ function db_add_column(&$ret, $table, $column, $type, $attributes = array()) { } } - $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, $column, $column_new, $type, $attribute } } - $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, &$context) { 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, &$context) { 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, $results, $operations) { 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 .= '