<?php
/**
 * 感谢使用 Mirai 未来主题，这是一款为 Typecho 打造的简约优雅、多功能现代化内容管理主题。
 * 作者：苏酷伊 Sukuy
 * 博客：https://www.sukuy.com
 * 作者QQ：1461139506
 * 注意：请勿使用盗版、破解主题，这类主题存在严重的未知安全风险！！！
 * ！！！尊重主题创作成果！！！
 */
if (!defined('__TYPECHO_ROOT_DIR__')) exit;

if (!defined('MIRAI_VERSION')) {
    define('MIRAI_VERSION', '1.0.6');
}
if (!defined('MIRAI_THEME_VERSION')) {
    define('MIRAI_THEME_VERSION', 1006);
}

require_once __DIR__ . '/core/auth-public.php';
$_envCfgFile = __DIR__ . '/common/functions/env-config.php';
$_envCfgExisted = is_file($_envCfgFile);
if ($_envCfgExisted) {
    require_once $_envCfgFile;
}


$_traceIdMissing = !defined('MIRAI_TRACE_ID') || MIRAI_TRACE_ID === '';
if (!defined('MIRAI_TRACE_ID')) define('MIRAI_TRACE_ID', '');
if (!defined('MIRAI_TRACE_TOKEN')) define('MIRAI_TRACE_TOKEN', '');

if (!$_envCfgExisted || $_traceIdMissing) {
    define('MIRAI_ENV_CFG_MISSING', true);
}
require_once __DIR__ . '/core/auth.php';
require_once __DIR__ . '/core/license.php';
require_once __DIR__ . '/core/update.php';
require_once __DIR__ . '/common/functions.php';
require_once __DIR__ . '/common/functions/music.php';
require_once __DIR__ . '/common/bootstrap.php';
require_once __DIR__ . '/common/control.php';
require_once __DIR__ . '/common/mysql/migration.php';
require_once __DIR__ . '/common/backup.php';
require_once __DIR__ . '/common/editor.php';
require_once __DIR__ . '/modules/upload.php';
require_once __DIR__ . '/modules/pagination.php';
require_once __DIR__ . '/common/config/theme-config.php';

Mirai_registerEditorHooks();

function themeActivate() {
    Mirai_ensureDatabaseSchema();
}