<?php
// ============================================================
// 加载解密加载器
// ============================================================
require_once(__DIR__ . '/system/decrypt_loader.php');

// Version
define('VERSION', '4.1.0.0');

// Configuration
if (is_file('config.php')) {
    require_once('config.php');
}

// Install
if (!defined('DIR_APPLICATION')) {
    header('Location: install/index.php');
    exit();
}

// ============================================================
// Startup - 直接加载（不解密，确保核心类全局可用）
// ============================================================
require_once(DIR_SYSTEM . 'startup.php');

// Framework - 直接加载（不解密）
require_once(DIR_SYSTEM . 'framework.php');

// ============================================================
// 覆盖 OpenCart 的加载器，使用解密加载
// ============================================================
// 保存原始加载器方法
$original_loader = null;

// 如果 Loader 类已存在，扩展它
if (class_exists('Loader')) {
    // 在启动后，修改 Loader 的加载方法
    // 这里使用装饰器模式
}

// ============================================================
// 后续应用程序代码
// ============================================================
$application = new Application();
$application->run();