You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
945 B

10 years ago
<?php
function getMigrationSchemas() {
return [ 0, 5 ];
}
function updateSchema($bdd, $newKey) {
if ($newKey === 0) {
$req_string = 'INSERT INTO `application` (sql_schema) VALUES (?)';
}
else {
$req_string = 'UPDATE `application` SET `sql_schema` = ?';
}
$req = $bdd->prepare($req_string);
$req->execute(array($newKey));
}
10 years ago
function printError($str) {
echo '<div class="alert alert-danger" role="alert">' . $str . '</div>';
}
10 years ago
function printSuccess($str) {
echo '<div class="alert alert-success" role="alert">' . $str . '</div>';
}
10 years ago
function isInstalled($bdd) {
$req = $bdd->prepare("SHOW TABLES LIKE 'admin'");
$req->execute();
10 years ago
if(!$req->fetch())
return false;
10 years ago
return true;
}
10 years ago
function hashPass($pass) {
return password_hash($pass, PASSWORD_DEFAULT);
}
10 years ago
function passEqual($pass, $hash) {
return password_verify($pass, $hash);
}
?>