mirror of
https://github.com/dg/dibi.git
synced 2025-08-05 21:58:10 +02:00
DibiPdoDriver: added support for version specified in options
If driver do not support ATTR_SERVER_VERSION (like dblib) fallback to the version from config, or set null as we do not know what is the driver version. I belive this is better solution then add some creazy switch with queries for all possible versions on all drivers, and becouse it is faster to pass variable then run query asking about version.
This commit is contained in:
committed by
David Grudl
parent
a3e5ac86f7
commit
94f34a2a33
@@ -19,6 +19,7 @@ require_once dirname(__FILE__) . '/DibiSqliteReflector.php';
|
||||
* - password (or pass)
|
||||
* - options (array) => driver specific options {@see PDO::__construct}
|
||||
* - resource (PDO) => existing connection
|
||||
* - version
|
||||
* - lazy, profiler, result, substitutes, ... => see DibiConnection options
|
||||
*
|
||||
* @author David Grudl
|
||||
@@ -78,7 +79,9 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver, IDibiResultDriver
|
||||
}
|
||||
|
||||
$this->driverName = $this->connection->getAttribute(PDO::ATTR_DRIVER_NAME);
|
||||
$this->serverVersion = $this->connection->getAttribute(PDO::ATTR_SERVER_VERSION);
|
||||
$this->serverVersion = isset($config['version'])
|
||||
? $config['version']
|
||||
: @$this->connection->getAttribute(PDO::ATTR_SERVER_VERSION); // @ - may be not supported
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user