hasInfoNewerVersion example


    public function __construct($name$info = null)
    {
        $this->info = new Enlight_Config($this->getInfo(), true);
        if ($info instanceof Enlight_Config) {
            $info->setAllowModifications();
            $updateVersion = null;
            $updateSource = null;

            if ($this->hasInfoNewerVersion($this->info, $info)) {
                $updateVersion = $this->info->get('version');
                $updateSource = $this->info->get('source');
            }

            $this->info->merge($info);
            if ($updateVersion !== null) {
                $this->info->set('updateVersion', $updateVersion);
                $this->info->set('updateSource', $updateSource);
            }
        }
        $this->info->set('capabilities', $this->getCapabilities());
        

        $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));

        
Home | Imprint | This part of the site doesn't use cookies.