This repository was archived by the owner on May 7, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77use App \Http \Requests ;
88
99use Illuminate \Support \Facades \File ;
10+ use Illuminate \Support \Facades \Artisan ;
11+
12+ // Composer dependencies to run from PHP
13+ use Composer \Console \Application ;
14+ use Symfony \Component \Console \Input \ArrayInput ;
1015
1116use ZipArchive ;
1217
@@ -25,7 +30,7 @@ public function downloadUpdate($version)
2530 {
2631 // This function gets the ZIP and extracts its contents to the correct dirs
2732 $ archive = 'https://github.com/Zettlr/wiki/archive/ ' . $ version . '.zip ' ;
28- $ dest = ' tmp.zip ' ;
33+ $ dest = base_path () . ' /storage/app/ tmp.zip ' ;
2934 $ foldername = false ;
3035
3136 $ ch = curl_init ();
@@ -118,7 +123,7 @@ public function moveUpdate()
118123
119124 // Remove old files
120125 foreach ($ diff ['remove ' ] as $ file ) {
121- File::delete (base_path () . $ file, File:: get ( base_path () . ' /storage/app/update_files/ ' . $ file ) );
126+ File::delete (base_path () . $ file );
122127 }
123128
124129 // Now the pure folder structure of this installation resembles the
@@ -135,7 +140,7 @@ public function migrateDatabase()
135140 // new tables, alterations and the like.
136141
137142 // We need to --force artisan to prevent security questions.
138- Artisan::call ('migrate --force ' );
143+ Artisan::call ('migrate ' , [ ' --force ' => true ] );
139144
140145 return response ()->json (['Database migration successful! ' , 200 ]);
141146 }
You can’t perform that action at this time.
0 commit comments