mirror of
https://github.com/dg/dibi.git
synced 2025-08-05 21:58:10 +02:00
used NotSupportedException at appropriate places
This commit is contained in:
@@ -44,12 +44,12 @@ class DibiFirebirdDriver extends DibiObject implements IDibiDriver, IDibiResultD
|
||||
|
||||
|
||||
/**
|
||||
* @throws DibiException
|
||||
* @throws NotSupportedException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if (!extension_loaded('interbase')) {
|
||||
throw new DibiDriverException("PHP extension 'interbase' is not loaded.");
|
||||
throw new NotSupportedException("PHP extension 'interbase' is not loaded.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ class DibiFirebirdDriver extends DibiObject implements IDibiDriver, IDibiResultD
|
||||
public function begin($savepoint = NULL)
|
||||
{
|
||||
if ($savepoint !== NULL) {
|
||||
throw new DibiDriverException('Savepoints are not supported in Firebird/Interbase.');
|
||||
throw new NotSupportedException('Savepoints are not supported in Firebird/Interbase.');
|
||||
}
|
||||
$this->transaction = ibase_trans($this->resource);
|
||||
$this->inTransaction = TRUE;
|
||||
@@ -186,11 +186,11 @@ class DibiFirebirdDriver extends DibiObject implements IDibiDriver, IDibiResultD
|
||||
public function commit($savepoint = NULL)
|
||||
{
|
||||
if ($savepoint !== NULL) {
|
||||
throw new DibiDriverException('Savepoints are not supported in Firebird/Interbase.');
|
||||
throw new NotSupportedException('Savepoints are not supported in Firebird/Interbase.');
|
||||
}
|
||||
|
||||
if (!ibase_commit($this->transaction)) {
|
||||
DibiDriverException('Unable to handle operation - failure when commiting transaction.');
|
||||
throw new DibiDriverException('Unable to handle operation - failure when commiting transaction.');
|
||||
}
|
||||
|
||||
$this->inTransaction = FALSE;
|
||||
@@ -207,11 +207,11 @@ class DibiFirebirdDriver extends DibiObject implements IDibiDriver, IDibiResultD
|
||||
public function rollback($savepoint = NULL)
|
||||
{
|
||||
if ($savepoint !== NULL) {
|
||||
throw new DibiDriverException('Savepoints are not supported in Firebird/Interbase.');
|
||||
throw new NotSupportedException('Savepoints are not supported in Firebird/Interbase.');
|
||||
}
|
||||
|
||||
if (!ibase_rollback($this->transaction)) {
|
||||
DibiDriverException('Unable to handle operation - failure when rolbacking transaction.');
|
||||
throw new DibiDriverException('Unable to handle operation - failure when rolbacking transaction.');
|
||||
}
|
||||
|
||||
$this->inTransaction = FALSE;
|
||||
@@ -409,7 +409,7 @@ class DibiFirebirdDriver extends DibiObject implements IDibiDriver, IDibiResultD
|
||||
*/
|
||||
public function seek($row)
|
||||
{
|
||||
throw new DibiDriverException("Firebird/Interbase do not support seek in result set.");
|
||||
throw new NotSupportedException("Firebird/Interbase do not support seek in result set.");
|
||||
}
|
||||
|
||||
|
||||
|
@@ -37,12 +37,12 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver, IDibiResultDriv
|
||||
|
||||
|
||||
/**
|
||||
* @throws DibiException
|
||||
* @throws NotSupportedException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if (!extension_loaded('mssql')) {
|
||||
throw new DibiDriverException("PHP extension 'mssql' is not loaded.");
|
||||
throw new NotSupportedException("PHP extension 'mssql' is not loaded.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -41,12 +41,12 @@ class DibiMsSql2005Driver extends DibiObject implements IDibiDriver, IDibiResult
|
||||
|
||||
|
||||
/**
|
||||
* @throws DibiException
|
||||
* @throws NotSupportedException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if (!extension_loaded('sqlsrv')) {
|
||||
throw new DibiDriverException("PHP extension 'sqlsrv' is not loaded.");
|
||||
throw new NotSupportedException("PHP extension 'sqlsrv' is not loaded.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -53,12 +53,12 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver, IDibiResultDriv
|
||||
|
||||
|
||||
/**
|
||||
* @throws DibiException
|
||||
* @throws NotSupportedException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if (!extension_loaded('mysql')) {
|
||||
throw new DibiDriverException("PHP extension 'mysql' is not loaded.");
|
||||
throw new NotSupportedException("PHP extension 'mysql' is not loaded.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -397,7 +397,7 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver, IDibiResultDriv
|
||||
public function getRowCount()
|
||||
{
|
||||
if (!$this->buffered) {
|
||||
throw new DibiDriverException('Row count is not available for unbuffered queries.');
|
||||
throw new NotSupportedException('Row count is not available for unbuffered queries.');
|
||||
}
|
||||
return mysql_num_rows($this->resultSet);
|
||||
}
|
||||
@@ -425,7 +425,7 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver, IDibiResultDriv
|
||||
public function seek($row)
|
||||
{
|
||||
if (!$this->buffered) {
|
||||
throw new DibiDriverException('Cannot seek an unbuffered result set.');
|
||||
throw new NotSupportedException('Cannot seek an unbuffered result set.');
|
||||
}
|
||||
|
||||
return mysql_data_seek($this->resultSet, $row);
|
||||
|
@@ -54,12 +54,12 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver, IDibiResultDri
|
||||
|
||||
|
||||
/**
|
||||
* @throws DibiException
|
||||
* @throws NotSupportedException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if (!extension_loaded('mysqli')) {
|
||||
throw new DibiDriverException("PHP extension 'mysqli' is not loaded.");
|
||||
throw new NotSupportedException("PHP extension 'mysqli' is not loaded.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -393,7 +393,7 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver, IDibiResultDri
|
||||
public function getRowCount()
|
||||
{
|
||||
if (!$this->buffered) {
|
||||
throw new DibiDriverException('Row count is not available for unbuffered queries.');
|
||||
throw new NotSupportedException('Row count is not available for unbuffered queries.');
|
||||
}
|
||||
return mysqli_num_rows($this->resultSet);
|
||||
}
|
||||
@@ -421,7 +421,7 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver, IDibiResultDri
|
||||
public function seek($row)
|
||||
{
|
||||
if (!$this->buffered) {
|
||||
throw new DibiDriverException('Cannot seek an unbuffered result set.');
|
||||
throw new NotSupportedException('Cannot seek an unbuffered result set.');
|
||||
}
|
||||
return mysqli_data_seek($this->resultSet, $row);
|
||||
}
|
||||
|
@@ -42,12 +42,12 @@ class DibiOdbcDriver extends DibiObject implements IDibiDriver, IDibiResultDrive
|
||||
|
||||
|
||||
/**
|
||||
* @throws DibiException
|
||||
* @throws NotSupportedException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if (!extension_loaded('odbc')) {
|
||||
throw new DibiDriverException("PHP extension 'odbc' is not loaded.");
|
||||
throw new NotSupportedException("PHP extension 'odbc' is not loaded.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,7 +313,7 @@ class DibiOdbcDriver extends DibiObject implements IDibiDriver, IDibiResultDrive
|
||||
$sql = 'SELECT TOP ' . (int) $limit . ' * FROM (' . $sql . ')';
|
||||
}
|
||||
|
||||
if ($offset) throw new InvalidArgumentException('Offset is not implemented in driver odbc.');
|
||||
if ($offset) throw new NotSupportedException('Offset is not implemented in driver odbc.');
|
||||
}
|
||||
|
||||
|
||||
|
@@ -44,12 +44,12 @@ class DibiOracleDriver extends DibiObject implements IDibiDriver, IDibiResultDri
|
||||
|
||||
|
||||
/**
|
||||
* @throws DibiException
|
||||
* @throws NotSupportedException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if (!extension_loaded('oci8')) {
|
||||
throw new DibiDriverException("PHP extension 'oci8' is not loaded.");
|
||||
throw new NotSupportedException("PHP extension 'oci8' is not loaded.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -42,12 +42,12 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver, IDibiResultDriver
|
||||
|
||||
|
||||
/**
|
||||
* @throws DibiException
|
||||
* @throws NotSupportedException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if (!extension_loaded('pdo')) {
|
||||
throw new DibiDriverException("PHP extension 'pdo' is not loaded.");
|
||||
throw new NotSupportedException("PHP extension 'pdo' is not loaded.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -434,7 +434,7 @@ class DibiPdoDriver extends DibiObject implements IDibiDriver, IDibiResultDriver
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
$row = @$this->resultSet->getColumnMeta($i); // intentionally @
|
||||
if ($row === FALSE) {
|
||||
throw new DibiDriverException('Driver does not support meta data.');
|
||||
throw new NotSupportedException('Driver does not support meta data.');
|
||||
}
|
||||
// PHP < 5.2.3 compatibility
|
||||
// @see: http://php.net/manual/en/pdostatement.getcolumnmeta.php#pdostatement.getcolumnmeta.changelog
|
||||
|
@@ -43,12 +43,12 @@ class DibiPostgreDriver extends DibiObject implements IDibiDriver, IDibiResultDr
|
||||
|
||||
|
||||
/**
|
||||
* @throws DibiException
|
||||
* @throws NotSupportedException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if (!extension_loaded('pgsql')) {
|
||||
throw new DibiDriverException("PHP extension 'pgsql' is not loaded.");
|
||||
throw new NotSupportedException("PHP extension 'pgsql' is not loaded.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -51,12 +51,12 @@ class DibiSqliteDriver extends DibiObject implements IDibiDriver, IDibiResultDri
|
||||
|
||||
|
||||
/**
|
||||
* @throws DibiException
|
||||
* @throws NotSupportedException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if (!extension_loaded('sqlite')) {
|
||||
throw new DibiDriverException("PHP extension 'sqlite' is not loaded.");
|
||||
throw new NotSupportedException("PHP extension 'sqlite' is not loaded.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ class DibiSqliteDriver extends DibiObject implements IDibiDriver, IDibiResultDri
|
||||
public function getRowCount()
|
||||
{
|
||||
if (!$this->buffered) {
|
||||
throw new DibiDriverException('Row count is not available for unbuffered queries.');
|
||||
throw new NotSupportedException('Row count is not available for unbuffered queries.');
|
||||
}
|
||||
return sqlite_num_rows($this->resultSet);
|
||||
}
|
||||
@@ -366,7 +366,7 @@ class DibiSqliteDriver extends DibiObject implements IDibiDriver, IDibiResultDri
|
||||
public function seek($row)
|
||||
{
|
||||
if (!$this->buffered) {
|
||||
throw new DibiDriverException('Cannot seek an unbuffered result set.');
|
||||
throw new NotSupportedException('Cannot seek an unbuffered result set.');
|
||||
}
|
||||
return sqlite_seek($this->resultSet, $row);
|
||||
}
|
||||
|
@@ -46,12 +46,12 @@ class DibiSqlite3Driver extends DibiObject implements IDibiDriver, IDibiResultDr
|
||||
|
||||
|
||||
/**
|
||||
* @throws DibiException
|
||||
* @throws NotSupportedException
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if (!extension_loaded('sqlite3')) {
|
||||
throw new DibiDriverException("PHP extension 'sqlite3' is not loaded.");
|
||||
throw new NotSupportedException("PHP extension 'sqlite3' is not loaded.");
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user