1
0
cms11/app/Console/Commands/Bundle/Upgrade.php

43 lines
971 B
PHP
Raw Normal View History

<?php
namespace App\Console\Commands\Bundle;
use App\Classes\Bundle;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Storage;
class Upgrade extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'bundle:upgrade { path? : Specific bundle to upgrade }';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Upgrade bundles from previous CMS version';
/**
* Execute the console command.
*/
public function handle()
{
$disk = Storage::disk(env('CONTENT_DISK'));
$path = $this->argument('path') ?? '/';
$bundles = Bundle::findBundles($disk, $path, true);
dd('Nothing to do');
foreach ($bundles as $bundle) {
$this->output->write(sprintf('Upgrading %s... ', $bundle->getPath()));
$this->info('OK');
}
}
}