mirror of
https://github.com/vrana/adminer.git
synced 2025-08-07 15:16:44 +02:00
Fix the uncaught exception because of namespace.
Signed-off-by: Takashi SHIRAI <shirai@nintendo.co.jp>
This commit is contained in:
committed by
Jakub Vrana
parent
2dd32cf534
commit
9f8344e53c
@@ -393,7 +393,7 @@ if (isset($_GET["sqlite"])) {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
$link = new SqliteDb($db);
|
$link = new SqliteDb($db);
|
||||||
} catch (Exception $ex) {
|
} catch (\Exception $ex) {
|
||||||
$connection->error = $ex->getMessage();
|
$connection->error = $ex->getMessage();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -13,7 +13,7 @@ if (extension_loaded('pdo')) {
|
|||||||
$options[\PDO::ATTR_STATEMENT_CLASS] = array('Adminer\PdoDbStatement');
|
$options[\PDO::ATTR_STATEMENT_CLASS] = array('Adminer\PdoDbStatement');
|
||||||
try {
|
try {
|
||||||
$this->pdo = new \PDO($dsn, $username, $password, $options);
|
$this->pdo = new \PDO($dsn, $username, $password, $options);
|
||||||
} catch (Exception $ex) {
|
} catch (\Exception $ex) {
|
||||||
auth_error(h($ex->getMessage()));
|
auth_error(h($ex->getMessage()));
|
||||||
}
|
}
|
||||||
$this->server_info = @$this->pdo->getAttribute(\PDO::ATTR_SERVER_VERSION);
|
$this->server_info = @$this->pdo->getAttribute(\PDO::ATTR_SERVER_VERSION);
|
||||||
|
@@ -25,7 +25,7 @@ if (isset($_GET["mongo"])) {
|
|||||||
function executeDbCommand($db, $command) {
|
function executeDbCommand($db, $command) {
|
||||||
try {
|
try {
|
||||||
return $this->_link->executeCommand($db, new \MongoDB\Driver\Command($command));
|
return $this->_link->executeCommand($db, new \MongoDB\Driver\Command($command));
|
||||||
} catch (Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->error = $e->getMessage();
|
$this->error = $e->getMessage();
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,7 @@ if (isset($_GET["mongo"])) {
|
|||||||
$results = $this->_link->executeBulkWrite($namespace, $bulk);
|
$results = $this->_link->executeBulkWrite($namespace, $bulk);
|
||||||
$this->affected_rows = $results->$counter();
|
$this->affected_rows = $results->$counter();
|
||||||
return true;
|
return true;
|
||||||
} catch (Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->error = $e->getMessage();
|
$this->error = $e->getMessage();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -331,7 +331,7 @@ if (isset($_GET["mongo"])) {
|
|||||||
$skip = $page * $limit;
|
$skip = $page * $limit;
|
||||||
try {
|
try {
|
||||||
return new Result($this->conn->_link->executeQuery($this->conn->_db_name . ".$table", new \MongoDB\Driver\Query($where, array('projection' => $select, 'limit' => $limit, 'skip' => $skip, 'sort' => $sort))));
|
return new Result($this->conn->_link->executeQuery($this->conn->_db_name . ".$table", new \MongoDB\Driver\Query($where, array('projection' => $select, 'limit' => $limit, 'skip' => $skip, 'sort' => $sort))));
|
||||||
} catch (Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->conn->error = $e->getMessage();
|
$this->conn->error = $e->getMessage();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user