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
68 lines
1.9 KiB
PHP
68 lines
1.9 KiB
PHP
<?php namespace System\Console;
|
|
|
|
use Winter\Storm\Console\Command;
|
|
use System\Classes\UpdateManager;
|
|
use System\Classes\PluginManager;
|
|
|
|
/**
|
|
* Console command to install a new plugin.
|
|
*
|
|
* This adds a new plugin by requesting it from the Winter marketplace.
|
|
*
|
|
* @package winter\wn-system-module
|
|
* @author Alexey Bobkov, Samuel Georges
|
|
*/
|
|
class PluginInstall extends Command
|
|
{
|
|
/**
|
|
* @var string|null The default command name for lazy loading.
|
|
*/
|
|
protected static $defaultName = 'plugin:install';
|
|
|
|
/**
|
|
* @var string The name and signature of this command.
|
|
*/
|
|
protected $signature = 'plugin:install
|
|
{plugin : The plugin to install. <info>(eg: Winter.Blog)</info>}';
|
|
|
|
/**
|
|
* @var string The console command description.
|
|
*/
|
|
protected $description = 'Install a plugin from the Winter marketplace.';
|
|
|
|
/**
|
|
* Execute the console command.
|
|
* @return void
|
|
*/
|
|
public function handle()
|
|
{
|
|
$pluginName = $this->argument('plugin');
|
|
$manager = UpdateManager::instance()->setNotesOutput($this->output);
|
|
|
|
$pluginDetails = $manager->requestPluginDetails($pluginName);
|
|
|
|
$code = array_get($pluginDetails, 'code');
|
|
$hash = array_get($pluginDetails, 'hash');
|
|
|
|
$this->output->writeln(sprintf('<info>Downloading plugin: %s</info>', $code));
|
|
$manager->downloadPlugin($code, $hash, true);
|
|
|
|
$this->output->writeln(sprintf('<info>Unpacking plugin: %s</info>', $code));
|
|
$manager->extractPlugin($code, $hash);
|
|
|
|
/*
|
|
* Make sure plugin is registered
|
|
*/
|
|
$pluginManager = PluginManager::instance();
|
|
$pluginManager->loadPlugins();
|
|
$plugin = $pluginManager->findByIdentifier($code);
|
|
$pluginManager->registerPlugin($plugin, $code);
|
|
|
|
/*
|
|
* Migrate plugin
|
|
*/
|
|
$this->output->writeln(sprintf('<info>Migrating plugin...</info>', $code));
|
|
$manager->updatePlugin($code);
|
|
}
|
|
}
|