You are here

function boost_update_6126 in Boost 6

Update 6126 - Reset boost-gzip-cookie-test.html.gz file

File

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

Code

function boost_update_6126() {
  $ret = array();

  // Make sure we have boost.module file loaded
  drupal_load('module', 'boost');
  $filename = BOOST_ROOT_CACHE_DIR . '/' . BOOST_PERM_GZ_DIR . '/boost-gzip-cookie-test.html.gz';
  if (is_file($filename) || is_link($filename)) {
    if (unlink($filename)) {
      _boost_generate_gzip_test_file();
      return array(
        array(
          'success' => TRUE,
          'query' => t('boost-gzip-cookie-test.html.gz file was reset'),
        ),
      );
    }
    else {
      return array(
        array(
          'success' => FALSE,
          'query' => t('boost-gzip-cookie-test.html.gz file was not deleted; please manually delete this file'),
        ),
      );
    }
  }
  else {
    return array(
      array(
        'success' => TRUE,
        'query' => t('boost-gzip-cookie-test.html.gz did not need to be reset'),
      ),
    );
  }
}