You are here

function boost_update_6113 in Boost 6

Update 6113 - Calculate url MD5 for boost_cache table

File

./boost.install, line 1142
Handles Boost module installation and upgrade tasks.

Code

function boost_update_6113() {
  $GLOBALS['_boost_max_execution_time'] = ini_get('max_execution_time');
  ini_set('max_execution_time', 10800);

  //3 Hours
  _boost_install_set_time_limit(0);
  $result = db_query("SELECT url FROM {boost_cache} WHERE hash_url = ''");
  while ($url = db_result($result)) {
    $hash = md5($url);
    db_query("UPDATE {boost_cache} SET hash_url = '%s' WHERE url = '%s'", $hash, $url);
  }
  _boost_install_set_time_limit(0);
  ini_set('max_execution_time', $GLOBALS['_boost_max_execution_time']);
  return array(
    array(
      'success' => TRUE,
      'query' => 'URLs hashed',
    ),
  );
}