<?php
declare(strict_types=1);

$dsn = 'mysql:host=127.0.0.1;dbname=shquier_easychair;charset=utf8mb4';
$user = 'root';
$pass = '_MohdShquier@2025!';

$pdo = new \PDO($dsn, $user, $pass, [
    \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION,
    \PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC,
]);

$pdo->exec("
    INSERT INTO app_meta (meta_key, meta_value)
    VALUES ('app_version','15')
    ON DUPLICATE KEY UPDATE meta_value = '15'
");

$lock = '/var/www/html/easychair/storage/system/install.lock';
@mkdir(dirname($lock), 0775, true);
if (!is_file($lock)) {
    file_put_contents($lock, date('c'));
}

echo "Pack 15 upgrade markers applied.\n";
