socketHandler(); $this->result = new Result(); $this->query = new Query(); $this->mysqli = new mysqli($this->host, $this->username, $this->password, $this->database, $this->port); $this->mysqli->set_charset($this->charset); $stmt = $this->mysqli->prepare('SET SESSION sql_mode = "TRADITIONAL"'); $stmt->execute(); $this->statement = new Statement($this->mysqli, $this->result, $this->query); $this->handler = $this; } /** * @param string $query * * @return mixed */ public function query($query) { $this->result->setValue($this->mysqli->query($query)); return $this->statement; } /** * @param string $query * * @return mixed */ public function prepare($query) { $this->query->setValue($query); return $this->statement; } /** * * @return mixed */ public function lastInsertId() { return $this->mysqli->insert_id; } /** * * @return mixed */ public function beginTransaction() { return $this->mysqli->begin_transaction(); } /** * @return bool */ public function commit() { return $this->mysqli->commit(); } /** * @return bool */ public function rollback() { return $this->mysqli->rollback(); } }