CommonGateway\CoreBundle\Service\InstallationService

The installation service is used to install plugins (or actually symfony bundles) on the gateway.

This class breaks complexity, methods and coupling rules. This could be solved by deviding the class into smaller classes but that would deminisch the readability of the code as a whole. All the code in this class is only used in an installation context, and it makes more sense to keep it together. Therefore, a design decision was made to keep al this code in one class.

Methods

Name Description
__construct The constructor sets al needed variables.
addActionConfiguration This function creates default configuration for the action.
install Installs the files from a bundle.
overrideConfig Overrides the default configuration of an Action. Will also set entity and source to id if a reference is given.
update Updates all commonground bundles on the common gateway installation.

InstallationService::__construct

Description

public __construct (\ComposerService $composerService, \EntityManagerInterface $entityManager, \GatewayResourceService $resourceService, \Kernel $kernel, \LoggerInterface $installationLogger, \SchemaService $schemaService, \CacheService $cacheService)

The constructor sets al needed variables.

Parameters

  • (\ComposerService) $composerService : The Composer service
  • (\EntityManagerInterface) $entityManager : The entity manager
  • (\GatewayResourceService) $resourceService : The resource service
  • (\Kernel) $kernel : The kernel
  • (\LoggerInterface) $installationLogger : The logger for the installation channel.
  • (\SchemaService) $schemaService : The schema service
  • (\CacheService) $cacheService : The cache service

Return Values

void


InstallationService::addActionConfiguration

Description

public addActionConfiguration (mixed $actionHandler)

This function creates default configuration for the action.

Parameters

  • (mixed) $actionHandler : The actionHandler for witch the default configuration is set.

Return Values

array


InstallationService::install

Description

public install (string $bundle, array $config)

Installs the files from a bundle.

Based on the default action handler so schould supoprt a config parrameter even if we do not use it.

Parameters

  • (string) $bundle : The bundle.
  • (array) $config : Optional config.

Return Values

bool

The result of the installation.

Throws Exceptions

\Exception


InstallationService::overrideConfig

Description

public overrideConfig (array $defaultConfig, array $overrides)

Overrides the default configuration of an Action. Will also set entity and source to id if a reference is given.

Parameters

  • (array) $defaultConfig
  • (array) $overrides

Return Values

array


InstallationService::update

Description

public update (array $config, \SymfonyStyle|null $style)

Updates all commonground bundles on the common gateway installation.

This functions serves as the jump of point for the commengateway:plugins:update command

Parameters

  • (array) $config : The (optional) configuration
  • (\SymfonyStyle|null) $style : In case we run update from the :initialize command and want cache:warmup to show IO messages.

Return Values

int

Throws Exceptions

\Exception