Fixed 404 error when installing
https://github.com/JulianPrieber/littlelink-custom/issues/313 https://www.youtube.com/watch?v=VJpZMZOBeB0
This commit is contained in:
parent
1726d027b2
commit
715726d330
|
@ -53,6 +53,11 @@ class InstallerController extends Controller
|
|||
$handle = $request->handle;
|
||||
$name = $request->name;
|
||||
|
||||
$file = base_path('INSTALLERLOCK');
|
||||
if (!file_exists($file)) {
|
||||
$handle = fopen($file, 'w') or die('Cannot create file: '.$file);
|
||||
fclose($handle);
|
||||
}
|
||||
|
||||
if(DB::table('users')->count() == '0'){
|
||||
Schema::disableForeignKeyConstraints();
|
||||
|
@ -137,6 +142,12 @@ class InstallerController extends Controller
|
|||
|
||||
if(file_exists(base_path("INSTALLING"))){unlink(base_path("INSTALLING"));}
|
||||
|
||||
$file = base_path('INSTALLERLOCK');
|
||||
if (file_exists($file)) {
|
||||
unlink($file) or die('Cannot delete file: '.$file);
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
return redirect(url(''));
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ if(file_exists(base_path('INSTALLING'))){
|
|||
|
||||
Route::get('{any}', function() {
|
||||
if(!DB::table('users')->get()->isEmpty()){
|
||||
if(file_exists(base_path("INSTALLING"))){unlink(base_path("INSTALLING"));header("Refresh:0");}
|
||||
if(file_exists(base_path("INSTALLING")) and !file_exists(base_path('INSTALLERLOCK'))){unlink(base_path("INSTALLING"));header("Refresh:0");}
|
||||
} else {
|
||||
return redirect(url(''));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue