Installer update

This commit is contained in:
Matteo Gheza 2020-06-02 14:54:35 +02:00
parent 350352fefd
commit d7fb952ea3
2 changed files with 8 additions and 2 deletions

View File

@ -2,7 +2,11 @@
require_once 'vendor/autoload.php';
use Tracy\Debugger;
require_once 'config.php';
try{
require_once 'config.php';
} catch(Exception $e){
header('Location: install/install.php');
}
session_start();
date_default_timezone_set('Europe/Rome');

View File

@ -327,7 +327,9 @@ CREATE TABLE `".$prefix."_dbversion` (
PRIMARY KEY (`id`),
KEY `Id` (`id`)
)ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `".$prefix."_dbversion` (`id`, `version`, `timestamp`) VALUES (NULL, '1', current_timestamp());");
INSERT INTO `".$prefix."_dbversion` (`id`, `version`, `timestamp`) VALUES (NULL, '1', current_timestamp()) WHERE NOT EXISTS (
SELECT version FROM `".$prefix."_dbversion` WHERE version = '1'
) LIMIT 1;");
} catch (Exception $e) {
if(is_cli()){
echo($e);