mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 21:24:35 -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 App\Utils\Ninja;
|
||||||
use Codedge\Updater\UpdaterManager;
|
use Codedge\Updater\UpdaterManager;
|
||||||
|
use Composer\Factory;
|
||||||
|
use Composer\IO\NullIO;
|
||||||
|
use Composer\Installer;
|
||||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||||
|
use Illuminate\Support\Facades\Artisan;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
class SelfUpdateController extends BaseController
|
class SelfUpdateController extends BaseController
|
||||||
@ -64,6 +68,27 @@ class SelfUpdateController extends BaseController
|
|||||||
|
|
||||||
$res = $updater->update();
|
$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);
|
return response()->json(['message'=>$res], 200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user