1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-06 14:16:39 +02:00

Driver's reflection capabilities moved to IDibiReflector

This commit is contained in:
David Grudl
2010-05-26 16:26:21 +02:00
parent 7bac2ef3b3
commit 8c99f0c04d
15 changed files with 38 additions and 180 deletions

View File

@@ -89,7 +89,7 @@ class DibiConnection extends DibiObject
$this->config = $config;
$this->driver = new $class;
// profiler
// profiler
$profilerCfg = & $config['profiler'];
if (is_numeric($profilerCfg) || is_bool($profilerCfg)) { // back compatibility
$profilerCfg = array('run' => (bool) $profilerCfg);
@@ -717,6 +717,9 @@ class DibiConnection extends DibiObject
*/
public function getDatabaseInfo()
{
if (!($this->driver instanceof IDibiReflector)) {
throw new NotSupportedException('Driver '. get_class($this->driver) . ' has not reflection capabilities.');
}
$this->connect();
return new DibiDatabaseInfo($this->driver, isset($this->config['database']) ? $this->config['database'] : NULL);
}