PrePluginUpdateEvent example


        $pluginBootstrap = $this->getPluginByName($plugin->getName());
        $this->requirementValidator->validate($pluginBootstrap->getPath() . '/plugin.xml', $this->release->getVersion());

        $context = new UpdateContext(
            $plugin,
            $this->release->getVersion(),
            $plugin->getVersion(),
            $plugin->getUpdateVersion()
        );

        $this->events->notify(PluginEvent::PRE_UPDATE, new PrePluginUpdateEvent($context$pluginBootstrap));

        $this->installResources($pluginBootstrap$plugin);

        $this->applyMigrations($pluginBootstrap, AbstractPluginMigration::MODUS_UPDATE);

        $pluginBootstrap->update($context);

        $this->events->notify(PluginEvent::POST_UPDATE, new PostPluginUpdateEvent($context$pluginBootstrap));

        $plugin->setVersion($context->getUpdateVersion());
        $plugin->setUpdateVersion(null);
        
Home | Imprint | This part of the site doesn't use cookies.