move into sonardesk
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Marketplace\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Modules\Marketplace\Models\InstalledPackage;
|
||||
|
||||
final class MarketplaceAuditCommand extends Command
|
||||
{
|
||||
protected $signature = 'marketplace:audit';
|
||||
|
||||
protected $description = 'Audit installed marketplace package state.';
|
||||
|
||||
public function handle(): int
|
||||
{
|
||||
$packages = InstalledPackage::query()->with('package')->get();
|
||||
foreach ($packages as $package) {
|
||||
$this->line(sprintf('%s %s [%s]%s', $package->package_name, $package->version, $package->status, $package->hasUpdate() ? ' update available' : ''));
|
||||
}
|
||||
$this->info($packages->count().' installed package(s) audited.');
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Marketplace\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
final class MarketplaceSyncCommand extends Command
|
||||
{
|
||||
protected $signature = 'marketplace:sync';
|
||||
|
||||
protected $description = 'Synchronise the configured marketplace catalogue.';
|
||||
|
||||
public function handle(): int
|
||||
{
|
||||
if (blank(config('marketplace.catalogue_url'))) {
|
||||
$this->warn('MARKETPLACE_CATALOGUE_URL is not configured.');
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
$this->info('Catalogue synchronisation is configured. Remote installs remain disabled unless explicitly enabled.');
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user