mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
improve install & update
This commit is contained in:
@@ -315,6 +315,7 @@ class TorrentRepository extends BaseRepository
|
|||||||
->where('uid', $uid)
|
->where('uid', $uid)
|
||||||
->whereIn('torrent_id', [0, $id])
|
->whereIn('torrent_id', [0, $id])
|
||||||
->orderBy('torrent_id', 'desc')
|
->orderBy('torrent_id', 'desc')
|
||||||
|
->orderBy('id', 'desc')
|
||||||
->first();
|
->first();
|
||||||
if ($secret) {
|
if ($secret) {
|
||||||
return $secret->secret;
|
return $secret->secret;
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class Install
|
|||||||
|
|
||||||
public function getLogFile()
|
public function getLogFile()
|
||||||
{
|
{
|
||||||
return sprintf('%s/nexus-install-%s.log', sys_get_temp_dir(), date('YmdHis'));
|
return sprintf('%s/nexus-install-%s.log', sys_get_temp_dir(), date('Ymd'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getInsallDirectory()
|
public function getInsallDirectory()
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class Update extends Install
|
|||||||
|
|
||||||
public function getLogFile()
|
public function getLogFile()
|
||||||
{
|
{
|
||||||
return sprintf('%s/nexus-update-%s.log', sys_get_temp_dir(), date('YmdHis'));
|
return sprintf('%s/nexus-update-%s.log', sys_get_temp_dir(), date('Ymd'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUpdateDirectory()
|
public function getUpdateDirectory()
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ if (!$install->canAccessStep($currentStep)) {
|
|||||||
$install->gotoStep(1);
|
$install->gotoStep(1);
|
||||||
}
|
}
|
||||||
$error = $copy = '';
|
$error = $copy = '';
|
||||||
|
$pass = true;
|
||||||
|
|
||||||
//step 1
|
//step 1
|
||||||
if ($currentStep == 1) {
|
if ($currentStep == 1) {
|
||||||
@@ -60,7 +61,6 @@ if ($currentStep == 2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($currentStep == 3) {
|
if ($currentStep == 3) {
|
||||||
$pass = true;
|
|
||||||
$shouldCreateTable = $install->listShouldCreateTable();
|
$shouldCreateTable = $install->listShouldCreateTable();
|
||||||
while ($isPost) {
|
while ($isPost) {
|
||||||
try {
|
try {
|
||||||
@@ -136,7 +136,6 @@ if ($currentStep == 5) {
|
|||||||
$error = $exception->getMessage();
|
$error = $exception->getMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$pass = true;
|
|
||||||
$userFormControls = [
|
$userFormControls = [
|
||||||
['label' => '用户名', 'name' => 'username', 'value' => $_POST['username'] ?? ''],
|
['label' => '用户名', 'name' => 'username', 'value' => $_POST['username'] ?? ''],
|
||||||
['label' => '邮箱', 'name' => 'email', 'value' => $_POST['email'] ?? ''],
|
['label' => '邮箱', 'name' => 'email', 'value' => $_POST['email'] ?? ''],
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ if (!$update->canAccessStep($currentStep)) {
|
|||||||
$update->gotoStep(1);
|
$update->gotoStep(1);
|
||||||
}
|
}
|
||||||
$error = $copy = '';
|
$error = $copy = '';
|
||||||
|
$pass = true;
|
||||||
|
|
||||||
//step 1
|
//step 1
|
||||||
if ($currentStep == 1) {
|
if ($currentStep == 1) {
|
||||||
@@ -67,7 +68,6 @@ if ($currentStep == 2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($currentStep == 3) {
|
if ($currentStep == 3) {
|
||||||
$pass = true;
|
|
||||||
$createTables = $update->listAllTableCreate();
|
$createTables = $update->listAllTableCreate();
|
||||||
$existsTables = $update->listExistsTable();
|
$existsTables = $update->listExistsTable();
|
||||||
$tableRows = [];
|
$tableRows = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user