1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-07 23:27:17 +02:00

Fix the uncaught exception because of namespace.

Signed-off-by: Takashi SHIRAI <shirai@nintendo.co.jp>
This commit is contained in:
Takashi SHIRAI
2025-03-19 15:23:02 +09:00
committed by Jakub Vrana
parent 2dd32cf534
commit 9f8344e53c
3 changed files with 5 additions and 5 deletions

View File

@@ -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;
} }

View File

@@ -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);

View File

@@ -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;
} }