mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for self updater (#3621)
This commit is contained in:
parent
ba55cc32e1
commit
9138980cbd
@ -13,7 +13,11 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\Utils\Ninja;
|
||||
use Codedge\Updater\UpdaterManager;
|
||||
use Composer\Factory;
|
||||
use Composer\IO\NullIO;
|
||||
use Composer\Installer;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class SelfUpdateController extends BaseController
|
||||
@ -64,6 +68,27 @@ class SelfUpdateController extends BaseController
|
||||
|
||||
$res = $updater->update();
|
||||
|
||||
try {
|
||||
Artisan::call('migrate');
|
||||
} catch (\Exception $e) {
|
||||
\Log::error("I wasn't able to migrate the data.");
|
||||
}
|
||||
|
||||
try {
|
||||
Artisan::call('optimize');
|
||||
} catch (\Exception $e) {
|
||||
\Log::error("I wasn't able to optimize.");
|
||||
}
|
||||
|
||||
$composer = Factory::create(new NullIO(), base_path('composer.json'), false);
|
||||
|
||||
$output = Installer::create(new NullIO, $composer)
|
||||
->setVerbose()
|
||||
->setUpdate(true)
|
||||
->run();
|
||||
|
||||
\Log::error(print_r($output,1));
|
||||
|
||||
return response()->json(['message'=>$res], 200);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user