mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-10 17:14:26 +02:00
Database locks are now having its very own functions
This commit is contained in:
parent
5de03c1b27
commit
d2cb87a200
2 changed files with 24 additions and 2 deletions
|
@ -806,6 +806,28 @@ class dba {
|
|||
return self::e($sql, $param);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Locks a table for exclusive write access
|
||||
*
|
||||
* This function can be extended in the future to accept a table array as well.
|
||||
*
|
||||
* @param string $table Table name
|
||||
*
|
||||
* @return boolean was the lock successful?
|
||||
*/
|
||||
static public function lock($table) {
|
||||
return self::e("LOCK TABLES `".self::$dbo->escape($table)."` WRITE");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Unlocks all locked tables
|
||||
*
|
||||
* @return boolean was the unlock successful?
|
||||
*/
|
||||
static public function unlock() {
|
||||
return self::e("UNLOCK TABLES");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Starts a transaction
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue