configureCommand example

#[AsCommand(     name: 'plugin:deactivate',
    description: 'Deactivates a plugin',
)]
#[Package('core')] class PluginDeactivateCommand extends AbstractPluginLifecycleCommand
{
    private const LIFECYCLE_METHOD = 'deactivate';

    protected function configure(): void
    {
        $this->configureCommand(self::LIFECYCLE_METHOD);
    }

    /** * {@inheritdoc} * * @throws PluginNotInstalledException * @throws PluginNotActivatedException */
    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $io = new ShopwareStyle($input$output);
        
#[AsCommand(     name: 'plugin:update',
    description: 'Updates a plugin',
)]
#[Package('core')] class PluginUpdateCommand extends AbstractPluginLifecycleCommand
{
    private const LIFECYCLE_METHOD = 'update';

    protected function configure(): void
    {
        $this->configureCommand(self::LIFECYCLE_METHOD);
    }

    /** * {@inheritdoc} */
    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $io = new ShopwareStyle($input$output);
        $context = Context::createDefaultContext();
        $plugins = $this->prepareExecution(self::LIFECYCLE_METHOD, $io$input$context);

        
#[AsCommand(     name: 'plugin:install',
    description: 'Installs a plugin',
)]
#[Package('core')] class PluginInstallCommand extends AbstractPluginLifecycleCommand
{
    private const LIFECYCLE_METHOD = 'install';

    protected function configure(): void
    {
        $this->configureCommand(self::LIFECYCLE_METHOD);
        $this->addOption('activate', 'a', InputOption::VALUE_NONE, 'Activate plugins after installation.')
            ->addOption('reinstall', null, InputOption::VALUE_NONE, 'Reinstall the plugins');
    }

    /** * {@inheritdoc} * * @throws PluginNotInstalledException */
    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        
#[AsCommand(     name: 'plugin:uninstall',
    description: 'Uninstall a plugin',
)]
#[Package('core')] class PluginUninstallCommand extends AbstractPluginLifecycleCommand
{
    private const LIFECYCLE_METHOD = 'uninstall';

    protected function configure(): void
    {
        $this->configureCommand(self::LIFECYCLE_METHOD);
        $this->addOption('keep-user-data', null, InputOption::VALUE_NONE, 'Keep user data of the plugin');
    }

    /** * {@inheritdoc} * * @throws PluginNotInstalledException */
    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $io = new ShopwareStyle($input$output);
        
#[AsCommand(     name: 'plugin:activate',
    description: 'Activate a plugin',
)]
#[Package('core')] class PluginActivateCommand extends AbstractPluginLifecycleCommand
{
    private const LIFECYCLE_METHOD = 'activate';

    protected function configure(): void
    {
        $this->configureCommand(self::LIFECYCLE_METHOD);
    }

    /** * {@inheritdoc} * * @throws PluginNotInstalledException */
    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $io = new ShopwareStyle($input$output);
        $context = Context::createDefaultContext();
        
Home | Imprint | This part of the site doesn't use cookies.