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)
5353 $ handle = $ request ->handle ;
5454 $ name = $ request ->name ;
5555
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+ }
5661
5762 if (DB ::table ('users ' )->count () == '0 ' ){
5863 Schema::disableForeignKeyConstraints ();
@@ -137,6 +142,12 @@ public function options(request $request)
137142
138143 if (file_exists (base_path ("INSTALLING " ))){unlink (base_path ("INSTALLING " ));}
139144
145+ $ file = base_path ('INSTALLERLOCK ' );
146+ if (file_exists ($ file )) {
147+ unlink ($ file ) or die ('Cannot delete file: ' .$ file );
148+ sleep (1 );
149+ }
150+
140151 return redirect (url ('' ));
141152 }
142153
Original file line number Diff line number Diff line change 4242
4343 Route::get ('{any} ' , function () {
4444 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 " );}
4646 } else {
4747 return redirect (url ('' ));
4848 }
You can’t perform that action at this time.
0 commit comments