session management
Some checks failed
PHPUnit / test (push) Has been cancelled

This commit is contained in:
tom.hempel
2026-06-30 08:35:18 +02:00
parent 7fefc264f4
commit 9db886a1ae
6 changed files with 7026 additions and 5 deletions

View File

@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
require dirname(__DIR__) . '/common.php';
require dirname(__DIR__) . '/db_init.php';
$path = dirname(__DIR__) . '/data/barometer_collection_import_bundle.json';
$bundle = json_decode(file_get_contents($path), true, 512, JSON_THROW_ON_ERROR);
[$pdo, $tmp, $lock] = qdb_open(true);
try {
$pdo->exec('PRAGMA foreign_keys = OFF;');
$result = qdb_import_questionnaires_bundle($pdo, $bundle, true);
$pdo->exec('PRAGMA foreign_keys = ON;');
qdb_save($tmp, $lock);
echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) . PHP_EOL;
} catch (Throwable $e) {
qdb_discard($tmp, $lock);
fwrite(STDERR, 'ERROR: ' . $e->getMessage() . PHP_EOL);
exit(1);
}