コード例 #1
0
ファイル: MysqlMutex.php プロジェクト: lianghongle/yii2-zh-cn
 /**
  * Initializes MySQL specific mutex component implementation.
  * @throws InvalidConfigException if [[db]] is not MySQL connection.
  */
 public function init()
 {
     parent::init();
     if ($this->db->driverName !== 'mysql') {
         throw new InvalidConfigException('In order to use MysqlMutex connection must be configured to use MySQL database.');
     }
 }
コード例 #2
0
ファイル: OracleMutex.php プロジェクト: Abbas-Hashemian/yii2
 /**
  * Initializes Oracle specific mutex component implementation.
  * @throws InvalidConfigException if [[db]] is not Oracle connection.
  */
 public function init()
 {
     parent::init();
     if (strpos($this->db->driverName, 'oci') !== 0 && strpos($this->db->driverName, 'odbc') !== 0) {
         throw new InvalidConfigException('In order to use OracleMutex connection must be configured to use Oracle database.');
     }
 }