配置说明

配置文件

创建 license/license.config.php 配置文件:

<?php
return [
    // 授权模式:domain, online, offline, code
    'license_mode' => 'domain',
    
    // 授权服务器地址
    'verify_url' => 'https://auth.xenl.ac.cn/license/api/verify.php',
    
    // 离线授权服务器地址
    'offline_url' => 'https://auth.xenl.ac.cn/license/api/offline.php',
    
    // 你的授权码
    'license_key' => 'LIC-xxxxxxxxxxxxx',
    
    // 应用密钥(用于签名验证)
    'app_key' => 'xxxxxxxxxxxxx',
    
    // 应用ID
    'app_id' => 'APP-YOUR-APP',
    
    // 离线授权文件路径
    'offline_license_file' => __DIR__ . '/license.dat',
    
    // 离线授权有效期(天)
    'offline_expiry_days' => 30,
    
    // 启用缓存
    'enable_cache' => true,
    
    // 缓存有效期(小时)
    'cache_hours' => 24,
    
    // 严格模式(验证失败阻止运行)
    'strict_mode' => true,
    
    // 显示详细信息
    'show_details' => false,
    
    // 启用错误日志
    'log_errors' => true,
    
    // 日志文件路径
    'log_file' => __DIR__ . '/logs/license.log',
    
    // 管理员豁免(管理员跳过验证)
    'admin_exempt' => true,
    'admin_indicator' => 'role',
    'admin_value' => 'admin',
    
    // 本地授权域名白名单(离线模式使用)
    'local_licensed_domains' => ['localhost', '127.0.0.1'],
    
    // 允许的授权模式
    'allowed_modes' => ['domain', 'online', 'offline', 'code'],
    
    // 请求超时(秒)
    'timeout' => 10,
    
    // 验证SSL证书
    'verify_ssl' => true,
    
    // 调试模式
    'debug' => false,
];