CRM-17394 - Initialize DB slightly later. Fix query-log and redundant SET NAMES.
authorTim Otten <totten@civicrm.org>
Mon, 16 Nov 2015 00:07:36 +0000 (16:07 -0800)
committerTim Otten <totten@civicrm.org>
Sun, 22 Nov 2015 20:22:18 +0000 (12:22 -0800)
commit3a036b15d0bb66177c35a848ab2b03c2595c93b6
treec5bf8b4ee0efab8e310b9708a4fb93225e9201f7
parent4ec52258c5afe0d4dad985233101dcb48a3ae0b2
CRM-17394 - Initialize DB slightly later. Fix query-log and redundant SET NAMES.

Strictly speaking, this patch does two different things:
 * Initialize DB slightly later. This fixes a race among settings-manager, DB init, and query logging.
 * Call `SET NAMES utf8` once during connection init. Before, it was called once for every DAO object.

Based on quick spot-check, it still seems to store UTF-8 data. To be safe,
I've added an extra error-check to ensure that the `SET NAMES utf8` is still
called before we actually use the DAO.
CRM/Core/DAO.php
CRM/Core/Error.php
Civi/Core/Container.php