mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
1bbfb67d8c
Reworked the internal disabled status checking and monitoring system for plugins. Added better support for plugin disabled status management. Added improvements to loading (should aid in improving app bootup speed)
53 lines
1.3 KiB
PHP
53 lines
1.3 KiB
PHP
<?php namespace System\Console;
|
|
|
|
use Winter\Storm\Console\Command;
|
|
use System\Classes\PluginManager;
|
|
use System\Models\PluginVersion;
|
|
|
|
/**
|
|
* Console command to enable a plugin.
|
|
*
|
|
* @package winter\wn-system-module
|
|
* @author Lucas Zamora
|
|
*/
|
|
class PluginEnable extends Command
|
|
{
|
|
use Traits\HasPluginArgument;
|
|
|
|
/**
|
|
* @var string Only suggest plugins that are disabled
|
|
*/
|
|
protected $hasPluginsFilter = 'disabled';
|
|
|
|
/**
|
|
* @var string|null The default command name for lazy loading.
|
|
*/
|
|
protected static $defaultName = 'plugin:enable';
|
|
|
|
/**
|
|
* @var string The name and signature of this command.
|
|
*/
|
|
protected $signature = 'plugin:enable
|
|
{plugin : The plugin to disable. <info>(eg: Winter.Blog)</info>}';
|
|
|
|
/**
|
|
* @var string The console command description.
|
|
*/
|
|
protected $description = 'Enable an existing plugin.';
|
|
|
|
/**
|
|
* Execute the console command.
|
|
* @return void
|
|
*/
|
|
public function handle()
|
|
{
|
|
$pluginName = $this->getPluginIdentifier();
|
|
$pluginManager = PluginManager::instance();
|
|
|
|
// Enable this plugin
|
|
$pluginManager->enablePlugin($pluginName);
|
|
|
|
$this->output->writeln(sprintf('<info>%s:</info> enabled.', $pluginName));
|
|
}
|
|
}
|