1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-04 13:17:58 +02:00

added IDibiDriver::getReflector()

This commit is contained in:
David Grudl
2010-08-05 21:03:08 +02:00
parent 9f982cb310
commit 65b5e2eecd
12 changed files with 118 additions and 4 deletions

View File

@@ -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;
}
}

View File

@@ -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**/

View File

@@ -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**/

View File

@@ -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**/

View File

@@ -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**/

View File

@@ -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**/

View File

@@ -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**/

View File

@@ -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**/

View File

@@ -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**/

View File

@@ -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**/

View File

@@ -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);
}

View File

@@ -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