42 lines
1.1 KiB
PHP
42 lines
1.1 KiB
PHP
|
<?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();
|
||
|
}
|
||
|
}*/
|
||
|
}
|