You are here

function boost_reset_database_file_submit in Boost 6

Resets boost database & cache directory

1 call to boost_reset_database_file_submit()
boost_admin_button_router in ./boost.admin.inc
1 string reference to 'boost_reset_database_file_submit'
boost_admin_boost_performance_page in ./boost.admin.inc
Form builder; Displays Boost's configuration page.

File

./boost.admin.inc, line 1638
All the code for the Boost module's administrative interface.

Code

function boost_reset_database_file_submit($form, &$form_state, $first = TRUE) {

  // Temp fix for bug in form api & buttons
  // Check to make sure this button was actually called
  if (!boost_admin_button_router(4, $first, $form, $form_state)) {
    return FALSE;
  }
  $ignore = variable_get('boost_ignore_flush', 0);
  $GLOBALS['conf']['boost_ignore_flush'] = 0;
  if (boost_cache_clear_all()) {
    db_query("TRUNCATE {boost_cache}");
    db_query("TRUNCATE {boost_cache_relationships}");
    db_query("TRUNCATE {boost_crawler}");
    _boost_rmdir_rf(BOOST_ROOT_CACHE_DIR, TRUE, TRUE, TRUE);
    drupal_set_message(t('Boost: Static page cache & 3 database tables cleared.'));
  }
  else {
    drupal_set_message(t('Boost: Set "Ignore cache flushing:" to \'Disabled\' in the <a href="!link">boost advanced settings</a> & try again.', array(
      '!link' => url('admin/settings/performance/boost', array(
        'fragment' => 'edit-boost-ignore-flush-0-wrapper',
      )),
    )), 'warning');
  }
  $GLOBALS['conf']['boost_ignore_flush'] = $ignore;
}