Commit: f6742bc85208072f9cefd2ee5a6de2dc83e65468

Author: Tyler Rooney | Date: 2011-04-12 09:45:38 -0300
Added client_flags to MySQL adapter's configuration
diff --git a/libraries/lithium/data/source/database/adapter/MySql.php b/libraries/lithium/data/source/database/adapter/MySql.php index 8172010..5d103f0 100644 --- a/libraries/lithium/data/source/database/adapter/MySql.php +++ b/libraries/lithium/data/source/database/adapter/MySql.php @@ -77,13 +77,14 @@ class MySql extends \lithium\data\source\Database { * followed by a port number or socket. Defaults to `'localhost:3306'`. * - `'persistent'`: If a persistent connection (if available) should be made. * Defaults to true. + * - `'flags'`: Client flags passed to mysql_connect. Defaults to `'null'`. * * Typically, these parameters are set in `Connections::add()`, when adding the adapter to the * list of active connections. * @return The adapter instance. */ public function __construct(array $config = array()) { - $defaults = array('host' => 'localhost:3306', 'encoding' => null); + $defaults = array('host' => 'localhost:3306', 'encoding' => null, 'flags' => null); parent::__construct($config + $defaults); } @@ -124,9 +125,9 @@ class MySql extends \lithium\data\source\Database { } if (!$config['persistent']) { - $this->connection = mysql_connect($host, $config['login'], $config['password'], true); + $this->connection = mysql_connect($host, $config['login'], $config['password'], true, $config['flags']); } else { - $this->connection = mysql_pconnect($host, $config['login'], $config['password']); + $this->connection = mysql_pconnect($host, $config['login'], $config['password'], $config['flags']); } if (!$this->connection) {