postUpdate example

'id' => $plugin->getId(),
                'version' => $updateVersion,
                'upgradeVersion' => null,
                'upgradedAt' => $updateDate->format(Defaults::STORAGE_DATE_TIME_FORMAT),
            ],
            $shopwareContext
        );
        $plugin->setVersion($updateVersion);
        $plugin->setUpgradeVersion(null);
        $plugin->setUpgradedAt($updateDate);

        $pluginBaseClass->postUpdate($updateContext);

        $this->eventDispatcher->dispatch(new PluginPostUpdateEvent($plugin$updateContext));

        return $updateContext;
    }

    /** * @throws PluginNotInstalledException */
    public function activatePlugin(PluginEntity $plugin, Context $shopwareContext, bool $reactivate = false): ActivateContext
    {
        
        $filetransfer->removeDirectory($args['install_dir'] . '/' . $this->name);
      }

      // Copy the directory in place.       $filetransfer->copyDirectory($this->source, $args['install_dir']);

      // Make sure what we just installed is readable by the web server.       $this->makeWorldReadable($filetransfer$args['install_dir'] . '/' . $this->name);

      // Run the updates.       // @todo Decide if we want to implement this.       $this->postUpdate();

      // For now, just return a list of links of things to do.       return $this->postUpdateTasks();
    }
    catch (FileTransferException $e) {
      throw new UpdaterFileTransferException("File Transfer failed, reason: '" . strtr($e->getMessage()$e->arguments) . "'");
    }
  }

  /** * Installs a Drupal project, returns a list of next actions. * * @param \Drupal\Core\FileTransfer\FileTransfer $filetransfer * Object that is a child of FileTransfer. * @param array $overrides * An array of settings to override defaults; see self::getInstallArgs(). * * @return array * An array of links which the user may need to complete the install. * * @throws \Drupal\Core\Updater\UpdaterFileTransferException */
Home | Imprint | This part of the site doesn't use cookies.