function 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 a certain display.
File
-
includes/
view.inc, line 1777
Class
- view
- An object to contain all of the data to generate a view.
Code
public 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);
}
}