$pluginBootstrap =
$this->
getPluginByName($plugin->
getName());
$context =
new InstallContext($plugin,
$this->release->
getVersion(),
$plugin->
getVersion());
$this->requirementValidator->
validate($pluginBootstrap->
getPath() . '/plugin.xml',
$this->release->
getVersion());
$this->events->
notify(PluginEvent::PRE_INSTALL,
new PrePluginInstallEvent($context,
$pluginBootstrap));
$this->
installResources($pluginBootstrap,
$plugin);
// Makes sure the version is updated in the db after a re-installation
if ($plugin->
getUpdateVersion() &&
$this->
hasInfoNewerVersion($plugin->
getUpdateVersion(),
$plugin->
getVersion())) { $plugin->
setVersion($plugin->
getUpdateVersion());
} $this->em->
flush($plugin);
$this->
applyMigrations($pluginBootstrap, AbstractPluginMigration::MODUS_INSTALL
);
$pluginBootstrap->
install($context);
$this->events->
notify(PluginEvent::POST_INSTALL,
new PostPluginInstallEvent($context,
$pluginBootstrap));