diff --git a/dibi/drivers/mssql.php b/dibi/drivers/mssql.php index e4b25075..1917e97c 100644 --- a/dibi/drivers/mssql.php +++ b/dibi/drivers/mssql.php @@ -181,6 +181,17 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver, IDibiResultDriv + /** + * Returns the connection reflector. + * @return IDibiReflector + */ + public function getReflector() + { + throw new NotSupportedException; + } + + + /********************* SQL ****************d*g**/ @@ -339,4 +350,5 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver, IDibiResultDriv return $this->resultSet; } + } diff --git a/dibi/drivers/mssql2005.php b/dibi/drivers/mssql2005.php index b3414875..d9be7a14 100644 --- a/dibi/drivers/mssql2005.php +++ b/dibi/drivers/mssql2005.php @@ -183,6 +183,17 @@ class DibiMsSql2005Driver extends DibiObject implements IDibiDriver, IDibiResult + /** + * Returns the connection reflector. + * @return IDibiReflector + */ + public function getReflector() + { + throw new NotSupportedException; + } + + + /********************* SQL ****************d*g**/ diff --git a/dibi/drivers/mysql.php b/dibi/drivers/mysql.php index fa044685..53431dd8 100644 --- a/dibi/drivers/mysql.php +++ b/dibi/drivers/mysql.php @@ -257,6 +257,17 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver, IDibiResultDriv + /** + * Returns the connection reflector. + * @return IDibiReflector + */ + public function getReflector() + { + return $this; + } + + + /********************* SQL ****************d*g**/ diff --git a/dibi/drivers/mysqli.php b/dibi/drivers/mysqli.php index 7cc22e8f..0bfdc45e 100644 --- a/dibi/drivers/mysqli.php +++ b/dibi/drivers/mysqli.php @@ -254,6 +254,17 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver, IDibiResultDri + /** + * Returns the connection reflector. + * @return IDibiReflector + */ + public function getReflector() + { + return $this; + } + + + /********************* SQL ****************d*g**/ diff --git a/dibi/drivers/odbc.php b/dibi/drivers/odbc.php index 3307bc20..941bef92 100644 --- a/dibi/drivers/odbc.php +++ b/dibi/drivers/odbc.php @@ -200,6 +200,17 @@ class DibiOdbcDriver extends DibiObject implements IDibiDriver, IDibiResultDrive + /** + * Returns the connection reflector. + * @return IDibiReflector + */ + public function getReflector() + { + return $this; + } + + + /********************* SQL ****************d*g**/ diff --git a/dibi/drivers/oracle.php b/dibi/drivers/oracle.php index feafcfe5..83f0a936 100644 --- a/dibi/drivers/oracle.php +++ b/dibi/drivers/oracle.php @@ -197,6 +197,17 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri + /** + * Returns the connection reflector. + * @return IDibiReflector + */ + public function getReflector() + { + return $this; + } + + + /********************* SQL ****************d*g**/ diff --git a/dibi/drivers/pdo.php b/dibi/drivers/pdo.php index 464dd02a..a54500d4 100644 --- a/dibi/drivers/pdo.php +++ b/dibi/drivers/pdo.php @@ -213,6 +213,17 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver, IDibiResultDriver + /** + * Returns the connection reflector. + * @return IDibiReflector + */ + public function getReflector() + { + throw new NotSupportedException; + } + + + /********************* SQL ****************d*g**/ diff --git a/dibi/drivers/postgre.php b/dibi/drivers/postgre.php index 23404630..a5224677 100644 --- a/dibi/drivers/postgre.php +++ b/dibi/drivers/postgre.php @@ -230,6 +230,17 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver, IDibiResultDr + /** + * Returns the connection reflector. + * @return IDibiReflector + */ + public function getReflector() + { + return $this; + } + + + /********************* SQL ****************d*g**/ diff --git a/dibi/drivers/sqlite.php b/dibi/drivers/sqlite.php index ddcbefde..96dfb651 100644 --- a/dibi/drivers/sqlite.php +++ b/dibi/drivers/sqlite.php @@ -204,6 +204,17 @@ class DibiSqliteDriver extends DibiObject implements IDibiDriver, IDibiResultDri + /** + * Returns the connection reflector. + * @return IDibiReflector + */ + public function getReflector() + { + return $this; + } + + + /********************* SQL ****************d*g**/ diff --git a/dibi/drivers/sqlite3.php b/dibi/drivers/sqlite3.php index f3f4aa21..42fa17e1 100644 --- a/dibi/drivers/sqlite3.php +++ b/dibi/drivers/sqlite3.php @@ -194,6 +194,17 @@ class DibiSqlite3Driver extends DibiObject implements IDibiDriver, IDibiResultDr + /** + * Returns the connection reflector. + * @return IDibiReflector + */ + public function getReflector() + { + return $this; + } + + + /********************* SQL ****************d*g**/ diff --git a/dibi/libs/DibiConnection.php b/dibi/libs/DibiConnection.php index 11651aac..c484bcc6 100644 --- a/dibi/libs/DibiConnection.php +++ b/dibi/libs/DibiConnection.php @@ -664,11 +664,8 @@ 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->connected || $this->connect(); - return new DibiDatabaseInfo($this->driver, isset($this->config['database']) ? $this->config['database'] : NULL); + return new DibiDatabaseInfo($this->driver->getReflector(), isset($this->config['database']) ? $this->config['database'] : NULL); } diff --git a/dibi/libs/interfaces.php b/dibi/libs/interfaces.php index 10157230..ecfb32cc 100644 --- a/dibi/libs/interfaces.php +++ b/dibi/libs/interfaces.php @@ -151,6 +151,12 @@ interface IDibiDriver */ function getResource(); + /** + * Returns the connection reflector. + * @return IDibiReflector + */ + function getReflector(); + /** * Encodes data for use in a SQL statement. * @param string value