function view::start_query_capture

3.x view.inc view::start_query_capture()
2.x view.inc view::start_query_capture()

Set up query capturing.

db_query() stores the queries that it runs in global $queries, bit only if dev_query is set to true. In this case, we want to temporarily override that setting if it's not and we can do that without forcing a db rewrite by just manipulating $conf. This is kind of evil but it works.

1 call to view::start_query_capture()
view::render in includes/view.inc
Render this view for display.

File

includes/view.inc, line 1284
view.inc Provides the view object type and associated methods.

Class

view
An object to contain all of the data to generate a view, plus the member functions to build the view query, execute the query and render the output.

Code

function start_query_capture() {
  global $conf, $queries;
  if (empty($conf['dev_query'])) {
    $this->fix_dev_query = TRUE;
    $conf['dev_query'] = TRUE;
  }

  // Record the last query key used; anything already run isn't
  // a query that we are interested in.
  $this->last_query_key = NULL;

  if (!empty($queries)) {
    $keys = array_keys($queries);
    $this->last_query_key = array_pop($keys);
  }
}