mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-06 08:15:36 +08:00
update to build 417
This commit is contained in:
@@ -21,12 +21,13 @@ class MySQLConnection implements Connection
|
||||
private $conn;
|
||||
|
||||
public function __construct() {
|
||||
Console::info("Constructing...");
|
||||
Console::debug("Constructing...");
|
||||
$this->conn = SqlPoolStorage::$sql_pool->getConnection();
|
||||
}
|
||||
|
||||
public function prepare($sql, $options = []) {
|
||||
try {
|
||||
Console::debug("Running SQL prepare: ".$sql);
|
||||
$statement = $this->conn->prepare($sql, $options);
|
||||
assert(($statement instanceof PDOStatementProxy) || ($statement instanceof PDOStatement));
|
||||
} catch (PDOException $exception) {
|
||||
@@ -51,6 +52,7 @@ class MySQLConnection implements Connection
|
||||
|
||||
public function exec($sql) {
|
||||
try {
|
||||
Console::debug("Running SQL exec: ".$sql);
|
||||
$statement = $this->conn->exec($sql);
|
||||
assert($statement !== false);
|
||||
return $statement;
|
||||
@@ -88,7 +90,7 @@ class MySQLConnection implements Connection
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
Console::info("Destructing!!!");
|
||||
Console::debug("Destructing!!!");
|
||||
SqlPoolStorage::$sql_pool->putConnection($this->conn);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user