Skip to content

Commit

Permalink
fix: 修复安装终止,无法进行下一步操作的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
jksdou committed May 13, 2024
1 parent 592a193 commit 5df8d77
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/includes/common.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

ini_set('display_errors', 'On');
error_reporting(E_ALL);
error_reporting(-1);
// error_reporting(0);
// ini_set('display_errors', 'On');
// error_reporting(E_ALL);
// error_reporting(-1);
error_reporting(0);
define('IN_CRONLITE', true);
define('VERSION', '1000');
define('APP_VERSION', '1.0.0');
define('VERSION', '1001');
define('APP_VERSION', '1.0.1');
define('SYSTEM_ROOT', dirname(__FILE__));
define('ROOT', dirname(SYSTEM_ROOT));
// define('CC_Defender', 1);
Expand Down
11 changes: 7 additions & 4 deletions src/install/index.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<?php
// ini_set('display_errors', 'On');
// error_reporting(E_ALL);
// error_reporting(-1);
error_reporting(0);
@header('Content-Type: text/html; charset=UTF-8');

define('ROOT', dirname(dirname(__FILE__)));

$step = isset($_GET['step']) ? $_GET['step'] : '0';

$installed = false;
if (file_exists(ROOT . '/install/install.lock')) {
$installed = true;
$step = '0';
Expand Down Expand Up @@ -193,7 +196,7 @@ function checkclass($f, $m = false)
</div>
<?php
require ROOT . '/install/db.class.php';
if (defined("SAE_ACCESSKEY") || $_GET['jump'] == 1) {
if (defined("SAE_ACCESSKEY") || (isset($_GET['jump']) && $_GET['jump'] == 1)) {
if (defined("SAE_ACCESSKEY")) {
include_once ROOT . '/includes/sae.php';
} else {
Expand All @@ -213,7 +216,7 @@ function checkclass($f, $m = false)
echo '<div class="alert alert-warning">连接数据库失败,[' . DB::connect_errno() . ']' . DB::connect_error() . '</div>';
} else {
echo '<div class="alert alert-success">数据库配置文件保存成功!</div>';
if (DB::query("select * from {$prefix}_config where 1") == FALSE) {
if (DB::query("select * from {$dbconfig['prefix']}_config where 1") == FALSE) {
echo '<a class="btn btn-primary btn-block" href="?step=4">创建数据表>></a>';
} else {
echo $str_installed;
Expand Down Expand Up @@ -294,7 +297,7 @@ function checkclass($f, $m = false)
DB::query("set sql_mode = ''");
DB::query("set names utf8");
$sqls[] = "INSERT INTO `" . $dbconfig['prefix'] . "_config` VALUES ('sys_key', '" . random(32) . "')";
$sqls[] = "INSERT INTO `" . $dbconfig['prefix'] . "_config` VALUES ('build_time', '" . $date("Y-m-d") . "')";
$sqls[] = "INSERT INTO `" . $dbconfig['prefix'] . "_config` VALUES ('build_time', '" . $date . "')";
$t = 0;
$e = 0;
$error = '';
Expand Down
3 changes: 1 addition & 2 deletions src/install/install.sql
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ INSERT INTO `pre_config` (`k`, `v`) VALUES
('keywords', '导航系统,网站导航,程江网址导航系统,分类目录'),
('description', '程江网址导航系统为您提供网站分类目录索引及网址大全库的建立,旨在为用户提供高效便捷的网址存储和查询服务,同时提供最全的优秀名站导航。'),
('icp', '沪ICP备20016252号'),
('build_time', '2021-10-25'),
('script_header', '<!-- script_header -->'),
('script_footer', '<!-- script_footer -->'),
('info', '免责声明:程江网址导航系统所列站点收集于全球互联网,内容与本站无关'),
Expand Down Expand Up @@ -207,7 +206,7 @@ CREATE TABLE IF NOT EXISTS `pre_article` (
) ENGINE=MyISAM DEFAULT CHARSET=utf8;</explode>

INSERT INTO `pre_article` (`id`, `name`, `catename`, `introduce`, `hits_total`, `tui`, `time`) VALUES
(1, '文章标题', '资源分享', '<p>文章详情信息</p>', 66, 1, '2021-10-25'),
(1, '文章标题', '资源分享', '<p>文章详情信息</p>', 66, 1, '2021-10-25');</explode>

CREATE TABLE IF NOT EXISTS `pre_like` (
`id` int(11) NOT NULL AUTO_INCREMENT,
Expand Down

0 comments on commit 5df8d77

Please sign in to comment.