install: create symbolic link first

This commit is contained in:
xiaomlove
2021-01-29 01:47:26 +08:00
parent 9f1d54be61
commit 7b66c600a4
5 changed files with 17 additions and 9 deletions
+3
View File
@@ -30,6 +30,9 @@ class class_cache_redis {
private function connect() private function connect()
{ {
$config = config('database.redis'); $config = config('database.redis');
if (empty($config['host'])) {
return false;
}
$redis = new Redis(); $redis = new Redis();
$params = [ $params = [
$config['host'], $config['host'],
+6 -2
View File
@@ -3,8 +3,12 @@ if(!defined('IN_TRACKER')) {
die('Hacking attempt!'); die('Hacking attempt!');
} }
if (!file_exists($rootpath . '.env')) { if (!file_exists($rootpath . '.env')) {
header('Location: ' . getBaseUrl() . 'install/install.php'); $installScriptRelativePath = 'install/install.php';
exit(0); $installScriptFile = $rootpath . "public/$installScriptRelativePath";
if (file_exists($installScriptFile)) {
header('Location: ' . getBaseUrl() . $installScriptRelativePath);
exit(0);
}
} }
error_reporting(E_ALL); error_reporting(E_ALL);
ini_set('display_errors', 0); ini_set('display_errors', 0);
+1
View File
@@ -465,6 +465,7 @@ class Install
continue; continue;
} }
$this->doLog("[IMPORT DATA] $table, $sql"); $this->doLog("[IMPORT DATA] $table, $sql");
sql_query("truncate table $table");
sql_query($sql); sql_query($sql);
} }
return true; return true;
+2 -2
View File
@@ -108,9 +108,9 @@ if ($currentStep == 4) {
$pass = $settingTableRows['pass']; $pass = $settingTableRows['pass'];
while ($isPost) { while ($isPost) {
try { try {
$install->importInitialData();
$install->saveSettings($settings);
$install->createSymbolicLinks($symbolicLinks); $install->createSymbolicLinks($symbolicLinks);
$install->saveSettings($settings);
$install->importInitialData();
$install->nextStep(); $install->nextStep();
} catch (\Exception $e) { } catch (\Exception $e) {
$_SESSION['error'] = $e->getMessage(); $_SESSION['error'] = $e->getMessage();
+5 -5
View File
@@ -91,8 +91,8 @@
'smtp_from' => NULL, 'smtp_from' => NULL,
'smtpaddress' => 'smtp.qq.com', 'smtpaddress' => 'smtp.qq.com',
'smtpport' => '25', 'smtpport' => '25',
'accountname' => '', 'accountname' => '353856593@qq.com',
'accountpassword' => '', 'accountpassword' => 'zixbeopslzidbgbi',
), ),
'security' => 'security' =>
array ( array (
@@ -347,8 +347,8 @@
'code' => 'code' =>
array ( array (
'mainversion' => 'NexusPHP', 'mainversion' => 'NexusPHP',
'subversion' => 'Standard v1.5 Beta 4 by xiaomlove', 'subversion' => 'v1.6.0-beta1',
'releasedate' => '2010-09-19', 'releasedate' => '2021-01-28',
'website' => '<a href="http://nexusphp.cn">http://nexusphp.cn</a>', 'website' => '<a href="http://nexusphp.cn" target="_blank">http://nexusphp.cn</a>',
), ),
); );