input->isInteractive()) { if (!$this->confirm('Are you sure you want to run the upgrade process for your Panel?')) { return; } } ini_set('output_buffering', 0); $bar = $this->output->createProgressBar(8); $bar->start(); $this->withProgress($bar, function () { $this->line('$upgrader> php artisan down'); $this->call('down'); }); $this->withProgress($bar, function () { $this->line('$upgrader> chmod -R 755 storage bootstrap/cache'); $process = new Process(['chmod', '-R', '755', 'storage', 'bootstrap/cache']); $process->run(function ($type, $buffer) { $this->{$type === Process::ERR ? 'error' : 'line'}($buffer); }); }); $this->withProgress($bar, function () { $command = ['composer', 'install', '--no-ansi']; if (config('app.env') === 'production' && !config('app.debug')) { $command[] = '--optimize-autoloader'; $command[] = '--no-dev'; } $this->line('$upgrader> ' . implode(' ', $command)); $process = new Process($command); $process->run(function ($type, $buffer) { $this->line($buffer); }); }); /** @var \Illuminate\Foundation\Application $app */ $app = require __DIR__ . '/../../../bootstrap/app.php'; /** @var \Pterodactyl\Console\Kernel $kernel */ $kernel = $app->make(Kernel::class); $kernel->bootstrap(); $this->setLaravel($app); $this->withProgress($bar, function () { $this->line('$upgrader> php artisan view:clear'); $this->call('view:clear'); }); $this->withProgress($bar, function () { $this->line('$upgrader> php artisan config:clear'); $this->call('config:clear'); }); $this->withProgress($bar, function () { $this->line('$upgrader> php artisan migrate --seed --force'); $this->call('migrate', ['--seed' => '', '--force' => '']); }); $this->withProgress($bar, function () { $this->line('$upgrader> php artisan queue:restart'); $this->call('queue:restart'); }); $this->withProgress($bar, function () { $this->line('$upgrader> php artisan up'); $this->call('up'); }); $this->newLine(); $this->info('Finished running upgrade.'); } protected function withProgress(ProgressBar $bar, Closure $callback) { $bar->clear(); $callback(); $bar->advance(); $bar->display(); } }