private function parseResources(SimpleXMLElement $resources)
{
// default values
$config = array('host' => null, 'port' => null, 'unix_socket' => null, 'dbname' => null, 'username' => null, 'password' => null);
$config = (array) $resources->default_setup->connection + $config;
$config['prefix'] = (string) $resources->db->table_prefix;
// known parameters: host, port, unix_socket, dbname, username, password, options, charset, persistent,
// driver_options
// (port is deprecated; removed in magento 2, use port in host setting <host>:<port>)
unset($config['comment']);
/* @see Varien_Db_Adapter_Pdo_Mysql::_connect */
if (strpos($config['host'], '/') !== false) {
$config['unix_socket'] = (string) $config['host'];
$config['host'] = null;
$config['port'] = null;
} elseif (strpos($config['host'], ':') !== false) {
list($config['host'], $config['port']) = explode(':', $config['host']);
$config['unix_socket'] = null;
}
$this->config = $config;
$this->tablePrefix = $config['prefix'];
$this->host = $config['host'];
$this->port = $config['port'];
$this->unixSocket = $config['unix_socket'];
$this->dbName = $config['dbname'];
$this->username = $config['username'];
$this->password = $config['password'];
}