<?php
$config = parse_ini_file(__DIR__ . '/../config/flashii.ini');
require_once $config['msz-path'] . '/lib/index/index.php';
header('Content-Type: application/json; charset=utf-8');
if(!is_file($config['msz-config-path'])) {
echo '{"error":101}';
exit;
}
$config = parse_ini_file($config['msz-config-path']);
if(empty($config['dsn'])) {
echo '{"error":102}';
try {
$db = \Index\Data\DbTools::create($config['dsn']);
$db->execute('SET SESSION time_zone = \'+00:00\', sql_mode = \'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION\';');
} catch(Exception $ex) {
echo json_encode(['error' => 103, 'msg' => $ex->getMessage()]);