Some checks are pending
Module sub-split / Sub-split (push) Waiting to run
- Base: wintercms/winter branch 1.2 (full framework) - Theme vivespos: Canvas 7 + Bootstrap 5 CDN, custom CSS - Layout: deferred GTM/GA4 tracking, JSON-LD SoftwareApplication - Partials: hero (offline-first), features, modes (offline/nube toggle), screenshots, pricing (3 planes), comparison, FAQ, CTA - Plugin VivesPOS.Site with ContactForm - Dockerfile: PHP 8.2 Apache, port 80, healthcheck - Added winter/wn-pages, blog, sitemap, seo plugins - Active theme set to vivespos
63 lines
1.7 KiB
PHP
63 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace System\Console\Asset;
|
|
|
|
use System\Classes\Asset\PackageManager;
|
|
use Winter\Storm\Console\Command;
|
|
use Winter\Storm\Support\Facades\File;
|
|
|
|
abstract class AssetList extends Command
|
|
{
|
|
protected string $assetType;
|
|
|
|
public function handle(): int
|
|
{
|
|
$compilableAssets = PackageManager::instance();
|
|
$compilableAssets->fireCallbacks();
|
|
|
|
$packages = $compilableAssets->getPackages($this->assetType, true);
|
|
|
|
if (count($packages) === 0) {
|
|
$this->info('No packages have been registered.');
|
|
return 0;
|
|
}
|
|
|
|
$errors = [];
|
|
|
|
$rows = [];
|
|
foreach ($packages as $name => $package) {
|
|
$rows[] = [
|
|
'name' => $name,
|
|
'active' => !$package['ignored'],
|
|
'path' => $package['path'],
|
|
'configuration' => $package['config'],
|
|
];
|
|
|
|
if (!File::exists($package['config'])) {
|
|
$errors[] = "The config file for $name doesn't exist, try running artisan $this->assetType:install";
|
|
}
|
|
}
|
|
|
|
if ($this->option('json')) {
|
|
$this->line(json_encode($rows, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
|
|
} else {
|
|
$this->line('');
|
|
$this->info('Packages registered:');
|
|
$this->line('');
|
|
$this->table(['Name', 'Active', 'Path', 'Configuration'], array_map(function ($row) {
|
|
$row['active'] = ($row['active']) ? '<info>Yes</info>' : '<fg=red>No</>';
|
|
return $row;
|
|
}, $rows));
|
|
$this->line('');
|
|
}
|
|
|
|
if (!empty($errors)) {
|
|
foreach ($errors as $error) {
|
|
$this->error($error);
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
}
|