update_fix_sessions

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

./update.php, строка 215

Версии
5
update_fix_sessions()

System update 130 changes the sessions table, which breaks the update script's ability to use session variables. This changes the table appropriately.

This code, including the 'update_sessions_fixed' variable, may be removed when update 130 is removed. It is part of the Drupal 4.6 to 4.7 migration.

Код

<?php
function update_fix_sessions() {
  $ret = array();

  if (drupal_get_installed_schema_version('system') < 130 && !variable_get('update_sessions_fixed', FALSE)) {
    if ($GLOBALS['db_type'] == 'mysql') {
      db_query("ALTER TABLE {sessions} ADD cache int(11) NOT NULL default '0' AFTER timestamp");
    }
    elseif ($GLOBALS['db_type'] == 'pgsql') {
      db_add_column($ret, 'sessions', 'cache', 'int', array('default' => 0, 'not null' => TRUE));
    }

    variable_set('update_sessions_fixed', TRUE);
  }
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему