// TODO: get new version (from composer.lock?)
$newVersion = '';
/** @var EventDispatcherInterface $eventDispatcher */
$eventDispatcher =
$this->container->
get('event_dispatcher'
);
$eventDispatcher->
dispatch(new UpdatePrePrepareEvent($context,
$currentVersion,
$newVersion));
/** @var EventDispatcherInterface $eventDispatcherWithoutPlugins */
$eventDispatcherWithoutPlugins =
$this->
rebootKernelWithoutPlugins()->
get('event_dispatcher'
);
// @internal plugins are deactivated
$eventDispatcherWithoutPlugins->
dispatch(new UpdatePostPrepareEvent($context,
$currentVersion,
$newVersion));
return self::SUCCESS;
} private function rebootKernelWithoutPlugins(): ContainerInterface
{ /** @var Kernel $kernel */
$kernel =
$this->container->
get('kernel'
);
$classLoad =
$kernel->
getPluginLoader()->
getClassLoader();
$kernel->
reboot(null,
new StaticKernelPluginLoader($classLoad));