Removed references to deprecated mysqli methods and constants.
This commit is contained in:
parent
365a455c94
commit
469391f9b6
2 changed files with 2 additions and 86 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
0.2410.630136
|
0.2410.630140
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
// MariaDbConnection.php
|
// MariaDbConnection.php
|
||||||
// Created: 2021-04-30
|
// Created: 2021-04-30
|
||||||
// Updated: 2024-10-19
|
// Updated: 2024-12-02
|
||||||
|
|
||||||
namespace Index\Db\MariaDb;
|
namespace Index\Db\MariaDb;
|
||||||
|
|
||||||
|
@ -16,62 +16,6 @@ use Index\Db\{DbConnection,DbTransaction};
|
||||||
* Represents a connection with a MariaDB or MySQL database server.
|
* Represents a connection with a MariaDB or MySQL database server.
|
||||||
*/
|
*/
|
||||||
class MariaDbConnection implements DbConnection {
|
class MariaDbConnection implements DbConnection {
|
||||||
/**
|
|
||||||
* Refresh grant tables.
|
|
||||||
*
|
|
||||||
* @var int
|
|
||||||
*/
|
|
||||||
public const REFRESH_GRANT = MYSQLI_REFRESH_GRANT;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Flushes logs, like the FLUSH LOGS; statement.
|
|
||||||
*
|
|
||||||
* @var int
|
|
||||||
*/
|
|
||||||
public const REFRESH_LOG = MYSQLI_REFRESH_LOG;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Refresh tables, like the FLUSH TABLES; statement.
|
|
||||||
*
|
|
||||||
* @var int
|
|
||||||
*/
|
|
||||||
public const REFRESH_TABLES = MYSQLI_REFRESH_TABLES;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Refreshes the hosts cache, like the FLUSH HOSTS; statement.
|
|
||||||
*
|
|
||||||
* @var int
|
|
||||||
*/
|
|
||||||
public const REFRESH_HOSTS = MYSQLI_REFRESH_HOSTS;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Refresh the status variables, like the FLUSH STATUS; statement.
|
|
||||||
*
|
|
||||||
* @var int
|
|
||||||
*/
|
|
||||||
public const REFRESH_STATUS = MYSQLI_REFRESH_STATUS;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Flushes the thread cache.
|
|
||||||
*
|
|
||||||
* @var int
|
|
||||||
*/
|
|
||||||
public const REFRESH_THREADS = MYSQLI_REFRESH_THREADS;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Resets information about the master server and restarts on slave replication servers,
|
|
||||||
* like the RESET SLAVE; statement.
|
|
||||||
*
|
|
||||||
* @var int
|
|
||||||
*/
|
|
||||||
public const REFRESH_SLAVE = MYSQLI_REFRESH_SLAVE;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Removes binary log files listed in the binary log index and truncates the index file
|
|
||||||
* on master replication servers, like the RESET MASTER; statement.
|
|
||||||
*/
|
|
||||||
public const REFRESH_MASTER = MYSQLI_REFRESH_MASTER;
|
|
||||||
|
|
||||||
private mysqli $connection;
|
private mysqli $connection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -295,24 +239,6 @@ class MariaDbConnection implements DbConnection {
|
||||||
return $this->connection->insert_id;
|
return $this->connection->insert_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sends a keep alive request to the server, or tries to reconnect if it has gone down.
|
|
||||||
*
|
|
||||||
* @return bool true if the keep alive was successful, false if the server is Gone.
|
|
||||||
*/
|
|
||||||
public function ping(): bool {
|
|
||||||
return $this->connection->ping();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Runs various refresh operations, see the REFRESH_ constants for the flags.
|
|
||||||
*
|
|
||||||
* @param int $flags A bitset of REFRESH_ flags.
|
|
||||||
*/
|
|
||||||
public function refresh(int $flags): void {
|
|
||||||
$this->connection->refresh($flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function beginTransaction(): DbTransaction {
|
public function beginTransaction(): DbTransaction {
|
||||||
if(!$this->connection->begin_transaction())
|
if(!$this->connection->begin_transaction())
|
||||||
$this->throwLastError();
|
$this->throwLastError();
|
||||||
|
@ -329,16 +255,6 @@ class MariaDbConnection implements DbConnection {
|
||||||
return $this->connection->thread_id;
|
return $this->connection->thread_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Asks the server to kill a thread.
|
|
||||||
*
|
|
||||||
* @param int $threadId ID of the thread that should be killed.
|
|
||||||
* @return bool true if the thread was killed, false if not.
|
|
||||||
*/
|
|
||||||
public function killThread(int $threadId): bool {
|
|
||||||
return $this->connection->kill($threadId);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return MariaDbStatement A database statement.
|
* @return MariaDbStatement A database statement.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue