function __construct()
{
parent::__construct();
$this->EE = get_instance();
// batch processing of queued queries
self::$queue = new stdClass();
self::$queue->inserts = array();
self::$queue->updates = array();
// Process the queue on shutdown.
// Note that as PHP-FPM does not support this function,
// we call process_queue() in Stash_ext::template_post_parse() as well.
// But, you ask, so why do this at all?
// Because if you SET/UPDATE a Stash variable outside of an EE
// template, you can't rely on extension hooks being triggered
register_shutdown_function(array($this, "process_queue"));
}