'. 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('Determine if a translation of this Drupal version is available in your language of choice. A translation is provided via a translation package; each translation package enables the display of a specific version of Drupal in a specific language. Not all languages are available for every version of Drupal.', array('@translations' => 'http://drupal.org/project/translations')) .'
';
- $output .= '
'. st('If an alternative translation package of your choice is available, download and extract its contents to your Drupal root directory.') .'
';
- $output .= '
'. st('Return to choose language using the second link below and select your desired language from the displayed list. Reloading the page allows the list to automatically adjust to the presence of new translation packages.') .'
';
- $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.') .'
' . 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('Determine if a translation of this Drupal version is available in your language of choice. A translation is provided via a translation package; each translation package enables the display of a specific version of Drupal in a specific language. Not all languages are available for every version of Drupal.', array('@translations' => 'http://drupal.org/project/translations')) . '
';
+ $output .= '
' . st('If an alternative translation package of your choice is available, download and extract its contents to your Drupal root directory.') . '
';
+ $output .= '
' . st('Return to choose language using the second link below and select your desired language from the displayed list. Reloading the page allows the list to automatically adjust to the presence of new translation packages.') . '
';
+ $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?') . '
'. 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 @@ function install_tasks($profile, $task)
// 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 @@ function install_tasks($profile, $task)
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 -d -F^\s*function -r1.253 update.php
--- update.php 19 Mar 2008 07:36:28 -0000 1.253
+++ update.php 10 Apr 2008 19:44:10 -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 . '
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 .= '
';
foreach ($updates as $number => $queries) {
if ($number != '#abort') {
- $output .= '
Update #'. $number .'
';
+ $output .= '
Update #' . $number . '
';
$output .= '
';
foreach ($queries as $query) {
if ($query['success']) {
- $output .= '
'. $query['query'] .'
';
+ $output .= '
' . $query['query'] . '
';
}
else {
- $output .= '
Failed: '. $query['query'] .'
';
+ $output .= '
Failed: ' . $query['query'] . '
';
}
}
if (!count($queries)) {
@@ -377,7 +377,7 @@ function update_info_page() {
$output .= "\n";
$output .= "
Back up your database. This process will change your database values and in case of emergency you may need to revert to a backup.
\n";
$output .= "
Back up your code. Hint: when backing up module code, do not leave that backup in the 'modules' or 'sites/*/modules' directories as this may confuse Drupal's auto-discovery mechanism.
Install your new files in the appropriate location, as described in the handbook.
\n";
$output .= "\n";
$output .= "
When you have performed the steps above, you may proceed.
\n";
@@ -439,7 +439,7 @@ function update_fix_compatibility() {
}
}
if (!empty($incompatible)) {
- $ret[] = update_sql("UPDATE {system} SET status = 0 WHERE name IN ('". implode("','", $incompatible) ."')");
+ $ret[] = update_sql("UPDATE {system} SET status = 0 WHERE name IN ('" . implode("','", $incompatible) . "')");
}
return $ret;
}
@@ -555,7 +555,7 @@ function update_check_requirements() {
if (isset($requirement['severity']) && $requirement['severity'] != REQUIREMENT_OK) {
$message = isset($requirement['description']) ? $requirement['description'] : '';
if (isset($requirement['value']) && $requirement['value']) {
- $message .= ' (Currently using '. $requirement['title'] .' '. $requirement['value'] .')';
+ $message .= ' (Currently using ' . $requirement['title'] . ' ' . $requirement['value'] . ')';
}
drupal_set_message($message, 'warning');
}
Index: includes/actions.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/actions.inc,v
retrieving revision 1.9
diff -u -d -F^\s*function -r1.9 actions.inc
--- includes/actions.inc 17 Feb 2008 22:15:04 -0000 1.9
+++ includes/actions.inc 10 Apr 2008 19:44:10 -0000
@@ -65,8 +65,8 @@ function actions_do($action_ids, $object
if ($where) {
$where_clause = implode(' ', $where);
// Strip off leading 'OR '.
- $where_clause = '('. strstr($where_clause, " ") .')';
- $result_db = db_query('SELECT * FROM {actions} WHERE '. $where_clause, $where_values);
+ $where_clause = '(' . strstr($where_clause, " ") . ')';
+ $result_db = db_query('SELECT * FROM {actions} WHERE ' . $where_clause, $where_values);
while ($action = db_fetch_object($result_db)) {
$actions[$action->aid] = $action->parameters ? unserialize($action->parameters) : array();
$actions[$action->aid]['callback'] = $action->callback;
Index: includes/batch.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/batch.inc,v
retrieving revision 1.14
diff -u -d -F^\s*function -r1.14 batch.inc
--- includes/batch.inc 20 Dec 2007 11:57:20 -0000 1.14
+++ includes/batch.inc 10 Apr 2008 19:44:10 -0000
@@ -78,7 +78,7 @@ function _batch_progress_page_js() {
$url = url($batch['url'], array('query' => array('id' => $batch['id'])));
$js_setting = array(
'batch' => array(
- 'errorMessage' => $current_set['error_message'] .' '. $batch['error_message'],
+ 'errorMessage' => $current_set['error_message'] . ' ' . $batch['error_message'],
'initMessage' => $current_set['init_message'],
'uri' => $url,
),
@@ -132,7 +132,7 @@ function _batch_progress_page_nojs() {
// function), it will output whatever is in the output buffer,
// followed by the error message.
ob_start();
- $fallback = $current_set['error_message'] .' '. $batch['error_message'];
+ $fallback = $current_set['error_message'] . ' ' . $batch['error_message'];
$fallback = theme('maintenance_page', $fallback, FALSE, FALSE);
// We strip the end of the page using a marker in the template, so any
@@ -153,7 +153,7 @@ function _batch_progress_page_nojs() {
}
$url = url($batch['url'], array('query' => array('id' => $batch['id'], 'op' => $new_op)));
- drupal_set_html_head('');
+ drupal_set_html_head('');
$output = theme('progress_bar', $percentage, $message);
return $output;
}
@@ -243,7 +243,7 @@ function _batch_process() {
'@current' => floor($current),
'@percentage' => $percentage,
);
- $message = strtr($progress_message, $values) .' ';
+ $message = strtr($progress_message, $values) . ' ';
$message .= $task_message ? $task_message : ' ';
return array($percentage, $message);
Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.207
diff -u -d -F^\s*function -r1.207 bootstrap.inc
--- includes/bootstrap.inc 8 Apr 2008 22:50:54 -0000 1.207
+++ includes/bootstrap.inc 10 Apr 2008 19:44:10 -0000
@@ -277,8 +277,8 @@ function conf_init() {
global $db_url, $db_prefix, $cookie_domain, $conf, $installed_profile, $update_free_access;
$conf = array();
- if (file_exists('./'. conf_path() .'/settings.php')) {
- include_once './'. conf_path() .'/settings.php';
+ if (file_exists('./' . conf_path() . '/settings.php')) {
+ include_once './' . conf_path() . '/settings.php';
}
if (isset($base_url)) {
@@ -287,7 +287,7 @@ function conf_init() {
if (!isset($parts['path'])) {
$parts['path'] = '';
}
- $base_path = $parts['path'] .'/';
+ $base_path = $parts['path'] . '/';
// Build $base_root (everything until first slash after "scheme://").
$base_root = substr($base_url, 0, strlen($base_url) - strlen($parts['path']));
}
@@ -297,7 +297,7 @@ function conf_init() {
// As $_SERVER['HTTP_HOST'] is user input, ensure it only contains
// characters allowed in hostnames.
- $base_url = $base_root .= '://'. preg_replace('/[^a-z0-9-:._]/i', '', $_SERVER['HTTP_HOST']);
+ $base_url = $base_root .= '://' . preg_replace('/[^a-z0-9-:._]/i', '', $_SERVER['HTTP_HOST']);
// $_SERVER['SCRIPT_NAME'] can, in contrast to $_SERVER['PHP_SELF'], not
// be modified by a visitor.
@@ -330,13 +330,13 @@ function conf_init() {
$cookie_domain = substr($cookie_domain, 4);
}
$cookie_domain = explode(':', $cookie_domain);
- $cookie_domain = '.'. $cookie_domain[0];
+ $cookie_domain = '.' . $cookie_domain[0];
// Per RFC 2109, cookie domains must contain at least one dot other than the
// first. For hosts such as 'localhost' or IP Addresses we don't set a cookie domain.
if (count(explode('.', $cookie_domain)) > 2 && !is_numeric(str_replace('.', '', $cookie_domain))) {
ini_set('session.cookie_domain', $cookie_domain);
}
- session_name('SESS'. md5($session_name));
+ session_name('SESS' . md5($session_name));
}
/**
@@ -566,7 +566,7 @@ function drupal_load($type, $name) {
*/
function drupal_page_header() {
header("Expires: Sun, 19 Nov 1978 05:00:00 GMT");
- header("Last-Modified: ". gmdate("D, d M Y H:i:s") ." GMT");
+ header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", FALSE);
}
@@ -582,8 +582,8 @@ function drupal_page_header() {
*/
function drupal_page_cache_header($cache) {
// Set default values:
- $last_modified = gmdate('D, d M Y H:i:s', $cache->created) .' GMT';
- $etag = '"'. md5($last_modified) .'"';
+ $last_modified = gmdate('D, d M Y H:i:s', $cache->created) . ' GMT';
+ $etag = '"' . md5($last_modified) . '"';
// See if the client has provided the required HTTP headers:
$if_modified_since = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE']) : FALSE;
@@ -720,10 +720,10 @@ function request_uri() {
}
else {
if (isset($_SERVER['argv'])) {
- $uri = $_SERVER['SCRIPT_NAME'] .'?'. $_SERVER['argv'][0];
+ $uri = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['argv'][0];
}
elseif (isset($_SERVER['QUERY_STRING'])) {
- $uri = $_SERVER['SCRIPT_NAME'] .'?'. $_SERVER['QUERY_STRING'];
+ $uri = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'];
}
else {
$uri = $_SERVER['SCRIPT_NAME'];
@@ -955,7 +955,7 @@ function _drupal_bootstrap($phase) {
// Deny access to blocked IP addresses - t() is not yet available.
if (drupal_is_denied(ip_address())) {
header('HTTP/1.1 403 Forbidden');
- print 'Sorry, '. check_plain(ip_address()) .' has been banned.';
+ print 'Sorry, ' . check_plain(ip_address()) . ' has been banned.';
exit();
}
break;
Index: includes/cache.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/cache.inc,v
retrieving revision 1.17
diff -u -d -F^\s*function -r1.17 cache.inc
--- includes/cache.inc 29 Jan 2008 11:36:06 -0000 1.17
+++ includes/cache.inc 10 Apr 2008 19:44:11 -0000
@@ -20,10 +20,10 @@ function cache_get($cid, $table = 'cache
// Reset the variable immediately to prevent a meltdown in heavy load situations.
variable_set('cache_flush', 0);
// Time to flush old cache data
- db_query("DELETE FROM {". $table ."} WHERE expire != %d AND expire <= %d", CACHE_PERMANENT, $cache_flush);
+ db_query("DELETE FROM {" . $table . "} WHERE expire != %d AND expire <= %d", CACHE_PERMANENT, $cache_flush);
}
- $cache = db_fetch_object(db_query("SELECT data, created, headers, expire, serialized FROM {". $table ."} WHERE cid = '%s'", $cid));
+ $cache = db_fetch_object(db_query("SELECT data, created, headers, expire, serialized FROM {" . $table . "} WHERE cid = '%s'", $cid));
if (isset($cache->data)) {
// If the data is permanent or we're not enforcing a minimum cache lifetime
// always return the cached data.
@@ -106,9 +106,9 @@ function cache_set($cid, $data, $table =
$serialized = 1;
}
$created = time();
- db_query("UPDATE {". $table ."} SET data = %b, created = %d, expire = %d, headers = '%s', serialized = %d WHERE cid = '%s'", $data, $created, $expire, $headers, $serialized, $cid);
+ db_query("UPDATE {" . $table . "} SET data = %b, created = %d, expire = %d, headers = '%s', serialized = %d WHERE cid = '%s'", $data, $created, $expire, $headers, $serialized, $cid);
if (!db_affected_rows()) {
- @db_query("INSERT INTO {". $table ."} (cid, data, created, expire, headers, serialized) VALUES ('%s', %b, %d, %d, '%s', %d)", $cid, $data, $created, $expire, $headers, $serialized);
+ @db_query("INSERT INTO {" . $table . "} (cid, data, created, expire, headers, serialized) VALUES ('%s', %b, %d, %d, '%s', %d)", $cid, $data, $created, $expire, $headers, $serialized);
}
}
@@ -157,26 +157,26 @@ function cache_clear_all($cid = NULL, $t
else if (time() > ($cache_flush + variable_get('cache_lifetime', 0))) {
// Clear the cache for everyone, cache_flush_delay seconds have
// passed since the first request to clear the cache.
- db_query("DELETE FROM {". $table ."} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, time());
+ db_query("DELETE FROM {" . $table . "} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, time());
variable_set('cache_flush', 0);
}
}
else {
// No minimum cache lifetime, flush all temporary cache entries now.
- db_query("DELETE FROM {". $table ."} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, time());
+ db_query("DELETE FROM {" . $table . "} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, time());
}
}
else {
if ($wildcard) {
if ($cid == '*') {
- db_query("DELETE FROM {". $table ."}");
+ db_query("DELETE FROM {" . $table . "}");
}
else {
- db_query("DELETE FROM {". $table ."} WHERE cid LIKE '%s%%'", $cid);
+ db_query("DELETE FROM {" . $table . "} WHERE cid LIKE '%s%%'", $cid);
}
}
else {
- db_query("DELETE FROM {". $table ."} WHERE cid = '%s'", $cid);
+ db_query("DELETE FROM {" . $table . "} WHERE cid = '%s'", $cid);
}
}
}
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.763
diff -u -d -F^\s*function -r1.763 common.inc
--- includes/common.inc 10 Apr 2008 10:19:01 -0000 1.763
+++ includes/common.inc 10 Apr 2008 19:44:12 -0000
@@ -105,7 +105,7 @@ function drupal_set_html_head($data = NU
static $stored_head = '';
if (!is_null($data)) {
- $stored_head .= $data ."\n";
+ $stored_head .= $data . "\n";
}
return $stored_head;
}
@@ -209,7 +209,7 @@ function drupal_query_string_encode($que
foreach ($query as $key => $value) {
$key = drupal_urlencode($key);
if ($parent) {
- $key = $parent .'['. $key .']';
+ $key = $parent . '[' . $key . ']';
}
if (in_array($key, $exclude)) {
@@ -220,7 +220,7 @@ function drupal_query_string_encode($que
$params[] = drupal_query_string_encode($value, $exclude, $key);
}
else {
- $params[] = $key .'='. drupal_urlencode($value);
+ $params[] = $key . '=' . drupal_urlencode($value);
}
}
@@ -239,16 +239,16 @@ function drupal_query_string_encode($que
*/
function drupal_get_destination() {
if (isset($_REQUEST['destination'])) {
- return 'destination='. urlencode($_REQUEST['destination']);
+ return 'destination=' . urlencode($_REQUEST['destination']);
}
else {
// Use $_GET here to retrieve the original path in source form.
$path = isset($_GET['q']) ? $_GET['q'] : '';
$query = drupal_query_string_encode($_GET, array('q'));
if ($query != '') {
- $path .= '?'. $query;
+ $path .= '?' . $query;
}
- return 'destination='. urlencode($path);
+ return 'destination=' . urlencode($path);
}
}
@@ -316,7 +316,7 @@ function drupal_goto($path = '', $query
// need all session data written to the database before redirecting.
session_write_close();
- header('Location: '. $url, TRUE, $http_response_code);
+ header('Location: ' . $url, TRUE, $http_response_code);
// The "Location" header sends a redirect status code to the HTTP daemon. In
// some cases this can be wrong, so we make sure none of the code below the
@@ -438,17 +438,17 @@ function drupal_http_request($url, $head
switch ($uri['scheme']) {
case 'http':
$port = isset($uri['port']) ? $uri['port'] : 80;
- $host = $uri['host'] . ($port != 80 ? ':'. $port : '');
+ $host = $uri['host'] . ($port != 80 ? ':' . $port : '');
$fp = @fsockopen($uri['host'], $port, $errno, $errstr, 15);
break;
case 'https':
// Note: Only works for PHP 4.3 compiled with OpenSSL.
$port = isset($uri['port']) ? $uri['port'] : 443;
- $host = $uri['host'] . ($port != 443 ? ':'. $port : '');
- $fp = @fsockopen('ssl://'. $uri['host'], $port, $errno, $errstr, 20);
+ $host = $uri['host'] . ($port != 443 ? ':' . $port : '');
+ $fp = @fsockopen('ssl://' . $uri['host'], $port, $errno, $errstr, 20);
break;
default:
- $result->error = 'invalid schema '. $uri['scheme'];
+ $result->error = 'invalid schema ' . $uri['scheme'];
return $result;
}
@@ -464,7 +464,7 @@ function drupal_http_request($url, $head
// Construct the path to act on.
$path = isset($uri['path']) ? $uri['path'] : '/';
if (isset($uri['query'])) {
- $path .= '?'. $uri['query'];
+ $path .= '?' . $uri['query'];
}
// Create HTTP request.
@@ -474,23 +474,23 @@ function drupal_http_request($url, $head
// host that do not take into account the port number.
'Host' => "Host: $host",
'User-Agent' => 'User-Agent: Drupal (+http://drupal.org/)',
- 'Content-Length' => 'Content-Length: '. strlen($data)
+ 'Content-Length' => 'Content-Length: ' . strlen($data)
);
// If the server url has a user then attempt to use basic authentication
if (isset($uri['user'])) {
- $defaults['Authorization'] = 'Authorization: Basic '. base64_encode($uri['user'] . (!empty($uri['pass']) ? ":". $uri['pass'] : ''));
+ $defaults['Authorization'] = 'Authorization: Basic ' . base64_encode($uri['user'] . (!empty($uri['pass']) ? ":" . $uri['pass'] : ''));
}
foreach ($headers as $header => $value) {
- $defaults[$header] = $header .': '. $value;
+ $defaults[$header] = $header . ': ' . $value;
}
- $request = $method .' '. $path ." HTTP/1.0\r\n";
+ $request = $method . ' ' . $path . " HTTP/1.0\r\n";
$request .= implode("\r\n", $defaults);
$request .= "\r\n\r\n";
if ($data) {
- $request .= $data ."\r\n";
+ $request .= $data . "\r\n";
}
$result->request = $request;
@@ -516,7 +516,7 @@ function drupal_http_request($url, $head
if (isset($result->headers[$header]) && $header == 'Set-Cookie') {
// RFC 2109: the Set-Cookie response header comprises the token Set-
// Cookie:, followed by a comma-separated list of one or more cookies.
- $result->headers[$header] .= ','. trim($value);
+ $result->headers[$header] .= ',' . trim($value);
}
else {
$result->headers[$header] = trim($value);
@@ -599,7 +599,7 @@ function drupal_error_handler($errno, $m
}
}
- $entry = $types[$errno] .': '. $message .' in '. $filename .' on line '. $line .'.';
+ $entry = $types[$errno] . ': ' . $message . ' in ' . $filename . ' on line ' . $line . '.';
// Force display of error messages in update.php.
if (variable_get('error_level', 1) == 1 || strstr($_SERVER['SCRIPT_NAME'], 'update.php')) {
@@ -719,7 +719,7 @@ function fix_gpc_magic() {
*
* Here is an example of t() used correctly:
* @code
- * $output .= '
'. t('Go to the contact page.', array('@contact-page' => url('contact'))) .'
';
+ * $output .= '
' . t('Go to the contact page.', array('@contact-page' => url('contact'))) . '
';
* @endcode
*
* Also avoid escaping quotation marks wherever possible.
@@ -761,7 +761,7 @@ function t($string, $args = array(), $la
// handful of string replacements. See settings.php for examples.
// Cache the $custom_strings variable to improve performance.
if (!isset($custom_strings[$langcode])) {
- $custom_strings[$langcode] = variable_get('locale_custom_strings_'. $langcode, array());
+ $custom_strings[$langcode] = variable_get('locale_custom_strings_' . $langcode, array());
}
// Custom strings work for English too, even if locale module is disabled.
if (isset($custom_strings[$langcode][$string])) {
@@ -838,10 +838,10 @@ function valid_email_address($mail) {
function valid_url($url, $absolute = FALSE) {
$allowed_characters = '[a-z0-9\/:_\-_\.\?\$,;~=#&%\+]';
if ($absolute) {
- return preg_match("/^(http|https|ftp):\/\/". $allowed_characters ."+$/i", $url);
+ return preg_match("/^(http|https|ftp):\/\/" . $allowed_characters . "+$/i", $url);
}
else {
- return preg_match("/^". $allowed_characters ."+$/i", $url);
+ return preg_match("/^" . $allowed_characters . "+$/i", $url);
}
}
@@ -904,14 +904,14 @@ function format_rss_channel($title, $lin
$langcode = $langcode ? $langcode : $language->language;
$output = "\n";
- $output .= ' '. check_plain($title) ."\n";
- $output .= ' '. check_url($link) ."\n";
+ $output .= ' ' . check_plain($title) . "\n";
+ $output .= ' ' . check_url($link) . "\n";
// The RSS 2.0 "spec" doesn't indicate HTML can be used in the description.
// We strip all HTML tags, but need to prevent double encoding from properly
// escaped source data (such as & becoming &).
- $output .= ' '. check_plain(decode_entities(strip_tags($description))) ."\n";
- $output .= ' '. check_plain($langcode) ."\n";
+ $output .= ' ' . check_plain(decode_entities(strip_tags($description))) . "\n";
+ $output .= ' ' . check_plain($langcode) . "\n";
$output .= format_xml_elements($args);
$output .= $items;
$output .= "\n";
@@ -926,9 +926,9 @@ function format_rss_channel($title, $lin
*/
function format_rss_item($title, $link, $description, $args = array()) {
$output = "\n";
- $output .= ' '. check_plain($title) ."\n";
- $output .= ' '. check_url($link) ."\n";
- $output .= ' '. check_plain($description) ."\n";
+ $output .= ' ' . check_plain($title) . "\n";
+ $output .= ' ' . check_url($link) . "\n";
+ $output .= ' ' . check_plain($description) . "\n";
$output .= format_xml_elements($args);
$output .= "\n";
@@ -954,13 +954,13 @@ function format_xml_elements($array) {
foreach ($array as $key => $value) {
if (is_numeric($key)) {
if ($value['key']) {
- $output .= ' <'. $value['key'];
+ $output .= ' <' . $value['key'];
if (isset($value['attributes']) && is_array($value['attributes'])) {
$output .= drupal_attributes($value['attributes']);
}
if ($value['value'] != '') {
- $output .= '>'. (is_array($value['value']) ? format_xml_elements($value['value']) : check_plain($value['value'])) .''. $value['key'] .">\n";
+ $output .= '>' . (is_array($value['value']) ? format_xml_elements($value['value']) : check_plain($value['value'])) . '' . $value['key'] . ">\n";
}
else {
$output .= " />\n";
@@ -968,7 +968,7 @@ function format_xml_elements($array) {
}
}
else {
- $output .= ' <'. $key .'>'. (is_array($value) ? format_xml_elements($value) : check_plain($value)) ."$key>\n";
+ $output .= ' <' . $key . '>' . (is_array($value) ? format_xml_elements($value) : check_plain($value)) . "$key>\n";
}
}
return $output;
@@ -1040,8 +1040,8 @@ function format_plural($count, $singular
return t($plural, $args, $langcode);
default:
unset($args['@count']);
- $args['@count['. $index .']'] = $count;
- return t(strtr($plural, array('@count' => '@count['. $index .']')), $args, $langcode);
+ $args['@count[' . $index . ']'] = $count;
+ return t(strtr($plural, array('@count' => '@count[' . $index . ']')), $args, $langcode);
}
}
}
@@ -1187,7 +1187,7 @@ function format_date($timestamp, $type =
// Special treatment for long month names: May is both an abbreviation
// and a full month name in English, but other languages have
// different abbreviations.
- $date .= trim(t('!long-month-name '. gmdate($c, $timestamp), array('!long-month-name' => ''), $langcode));
+ $date .= trim(t('!long-month-name ' . gmdate($c, $timestamp), array('!long-month-name' => ''), $langcode));
}
else if (strpos('BdgGhHiIjLmnsStTUwWYyz', $c) !== FALSE) {
$date .= gmdate($c, $timestamp);
@@ -1276,7 +1276,7 @@ function url($path = NULL, $options = ar
language_url_rewrite($path, $options);
}
if ($options['fragment']) {
- $options['fragment'] = '#'. $options['fragment'];
+ $options['fragment'] = '#' . $options['fragment'];
}
if (is_array($options['query'])) {
$options['query'] = drupal_query_string_encode($options['query']);
@@ -1287,7 +1287,7 @@ function url($path = NULL, $options = ar
if (strpos($path, '#') !== FALSE) {
list($path, $old_fragment) = explode('#', $path, 2);
if (isset($old_fragment) && !$options['fragment']) {
- $options['fragment'] = '#'. $old_fragment;
+ $options['fragment'] = '#' . $old_fragment;
}
}
// Append the query.
@@ -1335,14 +1335,14 @@ function url($path = NULL, $options = ar
custom_url_rewrite_outbound($path, $options, $original_path);
}
- $base = $options['absolute'] ? $options['base_url'] .'/' : base_path();
+ $base = $options['absolute'] ? $options['base_url'] . '/' : base_path();
$prefix = empty($path) ? rtrim($options['prefix'], '/') : $options['prefix'];
$path = drupal_urlencode($prefix . $path);
if ($clean_url) {
// With Clean URLs.
if ($options['query']) {
- return $base . $path .'?'. $options['query'] . $options['fragment'];
+ return $base . $path . '?' . $options['query'] . $options['fragment'];
}
else {
return $base . $path . $options['fragment'];
@@ -1352,13 +1352,13 @@ function url($path = NULL, $options = ar
// Without Clean URLs.
$variables = array();
if (!empty($path)) {
- $variables[] = 'q='. $path;
+ $variables[] = 'q=' . $path;
}
if (!empty($options['query'])) {
$variables[] = $options['query'];
}
if ($query = join('&', $variables)) {
- return $base . $script .'?'. $query . $options['fragment'];
+ return $base . $script . '?' . $query . $options['fragment'];
}
else {
return $base . $options['fragment'];
@@ -1378,7 +1378,7 @@ function drupal_attributes($attributes =
if (is_array($attributes)) {
$t = '';
foreach ($attributes as $key => $value) {
- $t .= " $key=".'"'. check_plain($value) .'"';
+ $t .= " $key=".'"' . check_plain($value) . '"';
}
return $t;
}
@@ -1450,7 +1450,7 @@ function l($text, $path, $options = arra
$options['attributes']['title'] = strip_tags($options['attributes']['title']);
}
- return ''. ($options['html'] ? $text : check_plain($text)) .'';
+ return '' . ($options['html'] ? $text : check_plain($text)) . '';
}
/**
@@ -1534,7 +1534,7 @@ function drupal_eval($code) {
}
ob_start();
- print eval('?>'. $code);
+ print eval('?>' . $code);
$output = ob_get_contents();
ob_end_clean();
@@ -1571,7 +1571,7 @@ function base_path() {
* Add a tag to the page's HEAD.
*/
function drupal_add_link($attributes) {
- drupal_set_html_head('\n");
+ drupal_set_html_head('\n");
}
/**
@@ -1688,7 +1688,7 @@ function drupal_get_css($css = NULL) {
// browser-caching. The string changes on every update or full cache
// flush, forcing browsers to load a new copy of the files, as the
// URL changed.
- $query_string = '?'. substr(variable_get('css_js_query_string', '0'), 0, 1);
+ $query_string = '?' . substr(variable_get('css_js_query_string', '0'), 0, 1);
foreach ($css as $media => $types) {
// If CSS preprocessing is off, we still need to output the styles.
@@ -1713,24 +1713,24 @@ function drupal_get_css($css = NULL) {
// If a CSS file is not to be preprocessed and it's a module CSS file, it needs to *always* appear at the *top*,
// regardless of whether preprocessing is on or off.
if (!$preprocess && $type == 'module') {
- $no_module_preprocess .= ''."\n";
+ $no_module_preprocess .= ''."\n";
}
// If a CSS file is not to be preprocessed and it's a theme CSS file, it needs to *always* appear at the *bottom*,
// regardless of whether preprocessing is on or off.
else if (!$preprocess && $type == 'theme') {
- $no_theme_preprocess .= ''."\n";
+ $no_theme_preprocess .= ''."\n";
}
else {
- $output .= ''."\n";
+ $output .= ''."\n";
}
}
}
}
if ($is_writable && $preprocess_css) {
- $filename = md5(serialize($types) . $query_string) .'.css';
+ $filename = md5(serialize($types) . $query_string) . '.css';
$preprocess_file = drupal_build_css_cache($types, $filename);
- $output .= ''."\n";
+ $output .= ''."\n";
}
}
@@ -1755,14 +1755,14 @@ function drupal_build_css_cache($types,
$csspath = file_create_path('css');
file_check_directory($csspath, FILE_CREATE_DIRECTORY);
- if (!file_exists($csspath .'/'. $filename)) {
+ if (!file_exists($csspath . '/' . $filename)) {
// Build aggregate CSS file.
foreach ($types as $type) {
foreach ($type as $file => $cache) {
if ($cache) {
$contents = drupal_load_stylesheet($file, TRUE);
// Return the path to where this CSS file originated from.
- $base = base_path() . dirname($file) .'/';
+ $base = base_path() . dirname($file) . '/';
_drupal_build_css_path(NULL, $base);
// Prefix all paths within this CSS file, ignoring external and absolute paths.
$data .= preg_replace_callback('/url\([\'"]?(?![a-z]+:|\/+)([^\'")]+)[\'"]?\)/i', '_drupal_build_css_path', $contents);
@@ -1778,9 +1778,9 @@ function drupal_build_css_cache($types,
$data = implode('', $matches[0]) . $data;
// Create the CSS file.
- file_save_data($data, $csspath .'/'. $filename, FILE_EXISTS_REPLACE);
+ file_save_data($data, $csspath . '/' . $filename, FILE_EXISTS_REPLACE);
}
- return $csspath .'/'. $filename;
+ return $csspath . '/' . $filename;
}
/**
@@ -1802,7 +1802,7 @@ function _drupal_build_css_path($matches
$last = $path;
$path = preg_replace('`(^|/)(?!../)([^/]+)/../`', '$1', $path);
}
- return 'url('. $path .')';
+ return 'url(' . $path . ')';
}
/**
@@ -1872,7 +1872,7 @@ function _drupal_load_stylesheet($matche
// Load the imported stylesheet and replace @import commands in there as well.
$file = drupal_load_stylesheet($filename);
// Alter all url() paths, but not external.
- return preg_replace('/url\(([\'"]?)(?![a-z]+:)([^\'")]+)[\'"]?\)?;/i', 'url(\1'. dirname($filename) .'/', $file);
+ return preg_replace('/url\(([\'"]?)(?![a-z]+:)([^\'")]+)[\'"]?\)?;/i', 'url(\1' . dirname($filename) . '/', $file);
}
/**
@@ -2039,7 +2039,7 @@ function drupal_get_js($scope = 'header'
// URL changed. Files that should not be cached (see drupal_add_js())
// get time() as query-string instead, to enforce reload on every
// page request.
- $query_string = '?'. substr(variable_get('css_js_query_string', '0'), 0, 1);
+ $query_string = '?' . substr(variable_get('css_js_query_string', '0'), 0, 1);
foreach ($javascript as $type => $data) {
@@ -2047,11 +2047,11 @@ function drupal_get_js($scope = 'header'
switch ($type) {
case 'setting':
- $output .= '\n";
+ $output .= '\n";
break;
case 'inline':
foreach ($data as $info) {
- $output .= '\n";
+ $output .= '\n";
}
break;
default:
@@ -2059,7 +2059,7 @@ function drupal_get_js($scope = 'header'
// Additionally, go through any remaining scripts if JS preprocessing is on and output the non-cached ones.
foreach ($data as $path => $info) {
if (!$info['preprocess'] || !$is_writable || !$preprocess_js) {
- $no_preprocess[$type] .= '\n";
+ $no_preprocess[$type] .= '\n";
}
else {
$files[$path] = $info;
@@ -2070,9 +2070,9 @@ function drupal_get_js($scope = 'header'
// Aggregate any remaining JS files that haven't already been output.
if ($is_writable && $preprocess_js && count($files) > 0) {
- $filename = md5(serialize($files) . $query_string) .'.js';
+ $filename = md5(serialize($files) . $query_string) . '.js';
$preprocess_file = drupal_build_js_cache($files, $filename);
- $preprocessed .= ''."\n";
+ $preprocessed .= ''."\n";
}
// Keep the order of JS files consistent as some are preprocessed and others are not.
@@ -2131,16 +2131,16 @@ function drupal_get_js($scope = 'header'
* the block regions on the admin/build/block page), a separate subgroup class
* must also be added to differentiate the groups.
* @code
- * $form['my_elements'][$region][$delta]['weight']['#attributes']['class'] = "my-elements-weight my-elements-weight-". $region;
+ * $form['my_elements'][$region][$delta]['weight']['#attributes']['class'] = "my-elements-weight my-elements-weight-" . $region;
* @endcode
*
* $group is still 'my-element-weight', and the additional $subgroup variable
- * will be passed in as 'my-elements-weight-'. $region. This also means that
+ * will be passed in as 'my-elements-weight-' . $region. This also means that
* you'll need to call drupal_add_tabledrag() once for every region added.
*
* @code
* foreach ($regions as $region) {
- * drupal_add_tabledrag('my-module-table', 'order', 'sibling', 'my-elements-weight', 'my-elements-weight-'. $region);
+ * drupal_add_tabledrag('my-module-table', 'order', 'sibling', 'my-elements-weight', 'my-elements-weight-' . $region);
* }
* @endcode
*
@@ -2227,20 +2227,20 @@ function drupal_build_js_cache($files, $
$jspath = file_create_path('js');
file_check_directory($jspath, FILE_CREATE_DIRECTORY);
- if (!file_exists($jspath .'/'. $filename)) {
+ if (!file_exists($jspath . '/' . $filename)) {
// Build aggregate JS file.
foreach ($files as $path => $info) {
if ($info['preprocess']) {
// Append a ';' after each JS file to prevent them from running together.
- $contents .= file_get_contents($path) .';';
+ $contents .= file_get_contents($path) . ';';
}
}
// Create the JS file.
- file_save_data($contents, $jspath .'/'. $filename, FILE_EXISTS_REPLACE);
+ file_save_data($contents, $jspath . '/' . $filename, FILE_EXISTS_REPLACE);
}
- return $jspath .'/'. $filename;
+ return $jspath . '/' . $filename;
}
/**
@@ -2598,7 +2598,7 @@ function drupal_system_listing($mask, $d
$files = array();
// Always search sites/all/* as well as the global directories
- $searchdir[] = 'sites/all/'. $directory;
+ $searchdir[] = 'sites/all/' . $directory;
// The 'profiles' directory contains pristine collections of modules and
// themes as organized by a distribution. It is pristine in the same way
@@ -2663,8 +2663,8 @@ function drupal_alter($type, &$data) {
array_shift($additional_args);
$args = array_merge($args, $additional_args);
- foreach (module_implements($type .'_alter') as $module) {
- $function = $module .'_'. $type .'_alter';
+ foreach (module_implements($type . '_alter') as $module) {
+ $function = $module . '_' . $type . '_alter';
call_user_func_array($function, $args);
}
}
@@ -3293,7 +3293,7 @@ function drupal_write_record($table, &$o
// Build the SQL.
$query = '';
if (!count($update)) {
- $query = "INSERT INTO {". $table ."} (". implode(', ', $fields) .') VALUES ('. implode(', ', $placeholders) .')';
+ $query = "INSERT INTO {" . $table . "} (" . implode(', ', $fields) . ') VALUES (' . implode(', ', $placeholders) . ')';
$return = SAVED_NEW;
}
else {
@@ -3302,15 +3302,15 @@ function drupal_write_record($table, &$o
if ($query) {
$query .= ', ';
}
- $query .= $field .' = '. $placeholders[$id];
+ $query .= $field . ' = ' . $placeholders[$id];
}
foreach ($update as $key){
- $conditions[] = "$key = ". db_type_placeholder($schema['fields'][$key]['type']);
+ $conditions[] = "$key = " . db_type_placeholder($schema['fields'][$key]['type']);
$values[] = $object->$key;
}
- $query = "UPDATE {". $table ."} SET $query WHERE ". implode(' AND ', $conditions);
+ $query = "UPDATE {" . $table . "} SET $query WHERE " . implode(' AND ', $conditions);
$return = SAVED_UPDATED;
}
@@ -3510,7 +3510,7 @@ function drupal_implode_tags($tags) {
foreach ($tags as $tag) {
// Commas and quotes in tag names are special cases, so encode them.
if (strpos($tag, ',') !== FALSE || strpos($tag, '"') !== FALSE) {
- $tag = '"'. str_replace('"', '""', $tag) .'"';
+ $tag = '"' . str_replace('"', '""', $tag) . '"';
}
$encoded_tags[] = $tag;
Index: includes/database.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database.inc,v
retrieving revision 1.92
diff -u -d -F^\s*function -r1.92 database.inc
--- includes/database.inc 8 Jan 2008 16:03:31 -0000 1.92
+++ includes/database.inc 10 Apr 2008 19:44:13 -0000
@@ -87,13 +87,13 @@ function db_prefix_tables($sql) {
$tmp = $db_prefix;
unset($tmp['default']);
foreach ($tmp as $key => $val) {
- $sql = strtr($sql, array('{'. $key .'}' => $val . $key));
+ $sql = strtr($sql, array('{' . $key . '}' => $val . $key));
}
return strtr($sql, array('{' => $db_prefix['default'], '}' => ''));
}
else {
foreach ($db_prefix as $key => $val) {
- $sql = strtr($sql, array('{'. $key .'}' => $val . $key));
+ $sql = strtr($sql, array('{' . $key . '}' => $val . $key));
}
return strtr($sql, array('{' => '', '}' => ''));
}
@@ -146,7 +146,7 @@ function db_set_active($name = 'default'
include_once $handler;
}
else {
- _db_error_page("The database type '". $db_type ."' is unsupported. Please use either 'mysql' or 'mysqli' for MySQL, or 'pgsql' for PostgreSQL databases.");
+ _db_error_page("The database type '" . $db_type . "' is unsupported. Please use either 'mysql' or 'mysqli' for MySQL, or 'pgsql' for PostgreSQL databases.");
}
$db_conns[$name] = db_connect($connect_url);
@@ -180,7 +180,7 @@ function _db_error_page($error = '') {
$message .= '
If you are the maintainer of this site, please check your database settings in the settings.php file and ensure that your hosting provider\'s database server is running. For more help, see the handbook, or contact your hosting provider.
';
if ($error && ini_get('display_errors')) {
- $message .= '