mirror of
https://github.com/vrana/adminer.git
synced 2025-08-12 17:44:07 +02:00
Improve concurrency
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1225 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
@@ -204,6 +204,15 @@ function cookie($name, $value) {
|
||||
return setcookie($name, $value, time() + 2592000, preg_replace('~\\?.*~', '', $_SERVER["REQUEST_URI"])); // 2592000 = 30 * 24 * 60 * 60
|
||||
}
|
||||
|
||||
/** Restart stopped session
|
||||
* @return null
|
||||
*/
|
||||
function restart_session() {
|
||||
if (!ini_get("session.use_cookies")) {
|
||||
session_start();
|
||||
}
|
||||
}
|
||||
|
||||
/** Send Location header and exit
|
||||
* @param string
|
||||
* @param string
|
||||
@@ -211,6 +220,7 @@ function cookie($name, $value) {
|
||||
*/
|
||||
function redirect($location, $message = null) {
|
||||
if (isset($message)) {
|
||||
session_start();
|
||||
$_SESSION["messages"][] = $message;
|
||||
}
|
||||
header("Location: " . (strlen($location) ? $location : "."));
|
||||
@@ -228,13 +238,13 @@ function redirect($location, $message = null) {
|
||||
*/
|
||||
function query_redirect($query, $location, $message, $redirect = true, $execute = true, $failed = false) {
|
||||
global $connection, $error, $adminer;
|
||||
if ($execute) {
|
||||
$failed = !$connection->query($query);
|
||||
}
|
||||
$sql = "";
|
||||
if ($query) {
|
||||
$sql = $adminer->messageQuery($query);
|
||||
}
|
||||
if ($execute) {
|
||||
$failed = !$connection->query($query);
|
||||
}
|
||||
if ($failed) {
|
||||
$error = h($connection->error) . $sql;
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user