You are here

function boost_get_settings_db in Boost 6

Gets boost settings from cache settings database.

Parameters

$router_item: Array containing page_callback, page_type & page_id.

3 calls to boost_get_settings_db()
boost_block_db_settings_form in ./boost.module
boost_cache_set in ./boost.module
Replaces/Sets the cached contents of the specified page, if stale.
boost_db_prep in ./boost.module
Figure out what is going in the database & put it in

File

./boost.module, line 4294
Provides static file caching for Drupal text output. Pages, Feeds, ect...

Code

function boost_get_settings_db($router_item) {
  $settings = array();

  // Get a more exact match first
  if (BOOST_FLUSH_ALL_MULTISITE) {
    $settings[] = db_fetch_array(db_query_range("SELECT * FROM {boost_cache_settings} WHERE page_callback = '%s' AND page_type = '%s' AND page_id = '%s'", $router_item['page_callback'], $router_item['page_type'], $router_item['page_id'], 0, 1));

    // Get for the content type
    $settings[] = db_fetch_array(db_query_range("SELECT * FROM {boost_cache_settings} WHERE page_callback = '%s' AND page_type = '%s' AND page_id = '%s'", $router_item['page_callback'], $router_item['page_type'], 0, 0, 1));

    // Finally get the content container (node, view, term, ect...)
    $settings[] = db_fetch_array(db_query_range("SELECT * FROM {boost_cache_settings} WHERE page_callback = '%s' AND page_type = '%s' AND page_id = '%s'", $router_item['page_callback'], 0, 0, 0, 1));
  }
  else {
    $settings[] = db_fetch_array(db_query_range("SELECT * FROM {boost_cache_settings} WHERE page_callback = '%s' AND page_type = '%s' AND base_dir = '%s' AND page_id = '%s'", $router_item['page_callback'], $router_item['page_type'], BOOST_FILE_PATH, $router_item['page_id'], 0, 1));

    // Get for the content type
    $settings[] = db_fetch_array(db_query_range("SELECT * FROM {boost_cache_settings} WHERE page_callback = '%s' AND page_type = '%s' AND base_dir = '%s' AND page_id = '%s'", $router_item['page_callback'], $router_item['page_type'], BOOST_FILE_PATH, 0, 0, 1));

    // Finally get the content container (node, view, term, ect...)
    $settings[] = db_fetch_array(db_query_range("SELECT * FROM {boost_cache_settings} WHERE page_callback = '%s' AND page_type = '%s' AND base_dir = '%s' AND page_id = '%s'", $router_item['page_callback'], 0, BOOST_FILE_PATH, 0, 0, 1));
  }
  return $settings;
}