PluginPostUninstallEvent example

$collection = new MigrationCollection(
            new MigrationSource('asd', []),
            new MigrationRuntime(new NullConnection()new NullLogger()),
            new NullConnection()
        );

        return [
            [new PluginPostInstallEvent($pluginnew InstallContext($rulePlugin$context, '', '', $collection))],
            [new PluginPostActivateEvent($pluginnew ActivateContext($rulePlugin$context, '', '', $collection))],
            [new PluginPostUpdateEvent($pluginnew UpdateContext($rulePlugin$context, '', '', $collection, ''))],
            [new PluginPostDeactivateEvent($pluginnew DeactivateContext($rulePlugin$context, '', '', $collection))],
            [new PluginPostUninstallEvent($pluginnew UninstallContext($rulePlugin$context, '', '', $collection, true))],
        ];
    }
}

/** * @internal */
#[Package('business-ops')] class RulePlugin extends Plugin
{
}
throw new PluginComposerJsonInvalidException(
                    $pluginBaseClass->getPath() . '/composer.json',
                    ['No name defined in composer.json']
                );
            }
            $this->executor->remove($pluginComposerName$plugin->getName());

            // running composer require may have consequences for other plugins, when they are required by the plugin being uninstalled             $this->pluginService->refreshPlugins($shopwareContextnew NullIO());
        }

        $this->eventDispatcher->dispatch(new PluginPostUninstallEvent($plugin$uninstallContext));

        return $uninstallContext;
    }

    /** * @throws RequirementStackException */
    public function updatePlugin(PluginEntity $plugin, Context $shopwareContext): UpdateContext
    {
        if ($plugin->getInstalledAt() === null) {
            throw new PluginNotInstalledException($plugin->getName());
        }
Home | Imprint | This part of the site doesn't use cookies.