Fix redirecting in setup

This commit is contained in:
Pig Fang 2019-03-15 13:21:47 +08:00
parent 13fade2773
commit c4b3cc89b0
2 changed files with 13 additions and 0 deletions

View File

@ -52,6 +52,8 @@ SALT = 2c5ca184f017a9a1ffbd198ef69b0c0e
#
APP_KEY = base64:gkb/zouNF6UOSfnr/o+izVMS57WQS3+62YqZBuDyBhU=
FIRST_RUN = true
# Mail Configuration
#
# Leave MAIL_DRIVER empty to disable features involving sending emails.

View File

@ -76,6 +76,11 @@ class SetupController extends Controller
'DB_PREFIX = '.$request->input('prefix'),
$content
);
$content = str_replace(
'FIRST_RUN = true',
'',
$content
);
File::put('..'.DIRECTORY_SEPARATOR.'.env', $content);
return redirect('setup/info');
@ -251,6 +256,12 @@ class SetupController extends Controller
}
}
// @codeCoverageIgnoreStart
if (env('FIRST_RUN') && request()->is('/')) {
return false;
}
// @codeCoverageIgnoreEnd
$existingTables = [];
$tables = $tables ?: ['users', 'user_closet', 'players', 'textures', 'options'];