lylme_spage/include/common.php

41 lines
1.5 KiB
PHP
Raw Normal View History

2022-01-20 15:38:11 +08:00
<?php
2023-12-16 17:20:06 +08:00
2024-05-06 00:37:40 +08:00
define('DEBUG', false); //调试模式 true(开启) 或 false(关闭)
define('ADMIN_PATH', 'admin'); //后台目录 用于防火墙白名单放行(修改后台目录后需要修改)
2022-03-12 15:23:32 +08:00
define('IN_CRONLITE', true);
2022-02-19 23:39:52 +08:00
define('SYS_KEY', 'lylme_key');
2023-12-16 17:20:06 +08:00
define('SYSTEM_ROOT', dirname(__FILE__) . '/');
define('ROOT', dirname(SYSTEM_ROOT) . '/');
2024-05-06 00:37:40 +08:00
if (!(version_compare(phpversion(), '7.1.0', '>=') && version_compare(phpversion(), '8.0.0', '<'))) {
exit('<h3>您的PHP版本过低或过高请将PHP版本修改为PHP7.1及以上不支持PHP8</h3>');
}
2023-12-16 17:20:06 +08:00
require ROOT . 'config.php';
2024-05-06 00:37:40 +08:00
if (!defined('SQLITE') && (!$dbconfig['user'] || !$dbconfig['pwd'] || !$dbconfig['dbname'])) {
2023-12-16 17:20:06 +08:00
@unlink(ROOT . 'install/install.lock');
header("Location:");
exit();
2022-01-20 15:38:11 +08:00
}
2023-12-16 17:20:06 +08:00
require SYSTEM_ROOT . "db.class.php";
$DB = new DB($dbconfig['host'], $dbconfig['user'], $dbconfig['pwd'], $dbconfig['dbname'], $dbconfig['port']);
2024-05-06 00:37:40 +08:00
require SYSTEM_ROOT . "site.php";
2023-12-17 23:45:03 +08:00
2023-12-16 17:20:06 +08:00
$web_config = $DB->query("SELECT * FROM `lylme_config`");
2024-05-06 00:37:40 +08:00
if (empty($web_config)) {
//数据表不存在
2023-12-26 22:40:33 +08:00
exit("<h3>LyLme Spage Error: MySQL config table is empty(code:404)<h3>");
}
2024-05-06 00:37:40 +08:00
while ($row = $DB->fetch($web_config)) {
//网站配置
2023-12-16 17:20:06 +08:00
$conf[$row['k']] = $row['v'];
}
2024-05-06 00:37:40 +08:00
require SYSTEM_ROOT . "include.php";
2023-12-16 17:20:06 +08:00
require SYSTEM_ROOT . "function.php";
2024-05-06 00:37:40 +08:00
require SYSTEM_ROOT . "lists.php";
2023-12-16 17:20:06 +08:00
require SYSTEM_ROOT . "member.php";
require SYSTEM_ROOT . "tj.php";
require SYSTEM_ROOT . "version.php";
require SYSTEM_ROOT . "updbase.php";
2024-05-06 00:37:40 +08:00
require SYSTEM_ROOT . 'lib/Form.php';