File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,11 @@ public function createAdmin(request $request)
53
53
$ handle = $ request ->handle ;
54
54
$ name = $ request ->name ;
55
55
56
+ $ file = base_path ('INSTALLERLOCK ' );
57
+ if (!file_exists ($ file )) {
58
+ $ handle = fopen ($ file , 'w ' ) or die ('Cannot create file: ' .$ file );
59
+ fclose ($ handle );
60
+ }
56
61
57
62
if (DB ::table ('users ' )->count () == '0 ' ){
58
63
Schema::disableForeignKeyConstraints ();
@@ -137,6 +142,12 @@ public function options(request $request)
137
142
138
143
if (file_exists (base_path ("INSTALLING " ))){unlink (base_path ("INSTALLING " ));}
139
144
145
+ $ file = base_path ('INSTALLERLOCK ' );
146
+ if (file_exists ($ file )) {
147
+ unlink ($ file ) or die ('Cannot delete file: ' .$ file );
148
+ sleep (1 );
149
+ }
150
+
140
151
return redirect (url ('' ));
141
152
}
142
153
Original file line number Diff line number Diff line change 42
42
43
43
Route::get ('{any} ' , function () {
44
44
if (!DB ::table ('users ' )->get ()->isEmpty ()){
45
- if (file_exists (base_path ("INSTALLING " ))){unlink (base_path ("INSTALLING " ));header ("Refresh:0 " );}
45
+ if (file_exists (base_path ("INSTALLING " )) and ! file_exists ( base_path ( ' INSTALLERLOCK ' )) ){unlink (base_path ("INSTALLING " ));header ("Refresh:0 " );}
46
46
} else {
47
47
return redirect (url ('' ));
48
48
}
You can’t perform that action at this time.
0 commit comments