Commit 37d7707f authored by ppetermann's avatar ppetermann

ok, fixing last fix

after my last commit i did some research in the php/pdo documentation and found that the port (well even the dsn) syntax depends a lot on the driver.
so my last 'fix' did fix it for mysql -  but broke it for dblib/mssql, this patch should make it work with those aswell (just moved jonwages solution to a own case for dblib & mssql driver). Someone should check if it works with the other drivers (i dont have all those database systems) cause looking at the doc
did show some more diffrences. (PHP Documentation for example says the dsn for pgsql needs to be delimited by spaces instead of semi-colons)
parent 2621996c
......@@ -336,13 +336,34 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
}
break;
case 'mssql':
case 'dblib':
if ( ! isset($parts['path']) || $parts['path'] == '/') {
throw new Doctrine_Manager_Exception('No database available in data source name');
}
if (isset($parts['path'])) {
$parts['database'] = substr($parts['path'], 1);
}
if ( ! isset($parts['host'])) {
throw new Doctrine_Manager_Exception('No hostname set in data source name');
}
if (isset(self::$driverMap[$parts['scheme']])) {
$parts['scheme'] = self::$driverMap[$parts['scheme']];
}
$parts['dsn'] = $parts['scheme'] . ':host='
. $parts['host'] . (isset($parts['port']) ? ':' . $parts['port']:null) . ';dbname='
. $parts['database'];
break;
case 'mysql':
case 'informix':
case 'oci8':
case 'oci':
case 'mssql':
case 'firebird':
case 'dblib':
case 'pgsql':
case 'odbc':
case 'mock':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment