This commit is contained in:
2024-11-20 15:55:20 +03:00
commit 12b888a674
5 changed files with 266 additions and 0 deletions

41
Connection.php Normal file
View File

@@ -0,0 +1,41 @@
<?php
namespace dominion\db;
use dominion\amqp\AmqpLoger;
/**
* Description of Connection
*
* @author noname
*/
class Connection extends \yii\db\Connection
{
public $commandClass = 'dominion\db\Command';
public $commandMap = [
'pgsql' => 'dominion\db\Command', // PostgreSQL
'mysqli' => 'dominion\db\Command', // MySQL
'mysql' => 'dominion\db\Command', // MySQL
'sqlite' => 'yii\db\sqlite\Command', // sqlite 3
'sqlite2' => 'yii\db\sqlite\Command', // sqlite 2
'sqlsrv' => 'dominion\db\Command', // newer MSSQL driver on MS Windows hosts
'oci' => 'yii\db\oci\Command', // Oracle driver
'mssql' => 'dominion\db\Command', // older MSSQL driver on MS Windows hosts
'dblib' => 'dominion\db\Command', // dblib drivers on GNU/Linux (and maybe other OSes) hosts
'cubrid' => 'dominion\db\Command', // CUBRID
];
/* public function open()
{
try
{
return parent::open();
}
catch (\Exception $ex)
{
AmqpLoger::log('reconnectDB', $ex->errorInfo);
return parent::open();
}
}*/
}