diff --git a/src/Mysql/Aspect/MysqlAspect.php b/src/Mysql/Aspect/MysqlAspect.php index b295b8e..d9f62af 100644 --- a/src/Mysql/Aspect/MysqlAspect.php +++ b/src/Mysql/Aspect/MysqlAspect.php @@ -61,7 +61,7 @@ public function aroundTransactional(MethodInvocation $invocation) * 如果当前没有事务,则抛出异常。 */ if (!$_transaction_in_progress) { - throw new TransactionException("Propagation::MANDATORY传播模式下当前没有事务"); + throw new TransactionException("Propagation::MANDATORY Currently there are no transactions in propagation mode"); } break; case Propagation::REQUIRES_NEW: @@ -86,14 +86,14 @@ public function aroundTransactional(MethodInvocation $invocation) */ $needTransaction = false; if ($_transaction_in_progress) { - throw new TransactionException("Propagation::NEVER传播模式下当前不能存在事务"); + throw new TransactionException("Propagation::NEVER Transactions cannot currently exist in propagation mode"); } break; case Propagation::NESTED: - throw new TransactionException("Propagation::NESTED 暂不支持"); + throw new TransactionException("Propagation::NESTED Not yet supported"); break; default: - throw new TransactionException("propagation设置不正确"); + throw new TransactionException("propagation Incorrect settings"); } if ($needNewGo) { //需要创建一个新的协程来执行mysql @@ -154,7 +154,7 @@ private function startTransaction(Transactional $transactional, \MysqliDb $db, M $this->mysql($transactional->name)->rawQuery("set session transaction isolation level serializable;"); break; default: - throw new TransactionException("isolation设置不正确"); + throw new TransactionException("isolation Incorrect settings"); } $db->startTransaction(); $result = null; diff --git a/src/Mysql/GetMysql.php b/src/Mysql/GetMysql.php index 3202a93..8153365 100644 --- a/src/Mysql/GetMysql.php +++ b/src/Mysql/GetMysql.php @@ -23,7 +23,7 @@ public function mysql($name = "default") /** @var MysqlManyPool $mysqlPool */ $mysqlPool = getDeepContextValueByClassName(MysqlManyPool::class); $pool = $mysqlPool->getPool($name); - if ($pool == null) throw new MysqlException("没有找到名为{$name}的mysql连接池"); + if ($pool == null) throw new MysqlException("No MySQL connection pool named {$name} was found"); return $pool->db(); } else { return $db; diff --git a/src/Mysql/MysqlManyPool.php b/src/Mysql/MysqlManyPool.php index 86f5fb5..f024345 100644 --- a/src/Mysql/MysqlManyPool.php +++ b/src/Mysql/MysqlManyPool.php @@ -30,7 +30,7 @@ public function db(): MysqliDb { $default = $this->getPool(); if ($default == null) { - throw new MysqlException("没有设置默认的mysql"); + throw new MysqlException("No default MySQL is set"); } return $default->db(); } diff --git a/src/Mysql/MysqlOneConfig.php b/src/Mysql/MysqlOneConfig.php index c864058..919999b 100644 --- a/src/Mysql/MysqlOneConfig.php +++ b/src/Mysql/MysqlOneConfig.php @@ -214,25 +214,25 @@ public function setCharset(string $charset): void public function buildConfig() { if (!extension_loaded('mysqli')) { - throw new MysqlException("缺少mysqli扩展"); + throw new MysqlException("Lack of mysqli expansion"); } if ($this->poolMaxNumber < 1) { - throw new MysqlException("poolMaxNumber必须大于1"); + throw new MysqlException("PoolMaxNumber must be greater than 1"); } if (empty($this->name)) { - throw new MysqlException("name必须设置"); + throw new MysqlException("name must be set"); } if (empty($this->host)) { - throw new MysqlException("host必须设置"); + throw new MysqlException("host must be set"); } if (empty($this->username)) { - throw new MysqlException("username必须设置"); + throw new MysqlException("username must be set"); } if (empty($this->password)) { - throw new MysqlException("password必须设置"); + throw new MysqlException("password must be set"); } if (empty($this->db)) { - throw new MysqlException("db必须设置"); + throw new MysqlException("db must be set"); } return ['host' => $this->host, 'username' => $this->username,