class PluginDriver extends AbstractDriver (View source)

Installer driver to process plugins (out-of-framework event listeners)

This class will parse every "plugins" extra field. It expects the field syntax to be like the following:

"extra": { "plugins": [ { "class": "\My\Plugin", "event": "custom.event", "priority": 0, // <= plugin priority if other plugins share same event "onetime": true // <= this will make plugin fire only once }, { "class": "\My\OtherPlugin", "event": "custom.anotherevent" } ] }

Properties

protected Composer $composer from AbstractDriver
protected IOInterface $io from AbstractDriver
protected Configuration $configuration from AbstractDriver
protected InstallerParameters $parameters from AbstractDriver
protected InstallerPersistenceInterface $persistence from AbstractDriver
protected array $base_plugin Basic plugin configuration

Methods

__construct(Composer $composer, IOInterface $io, Configuration $configuration, InstallerParameters $parameters, InstallerPersistenceInterface $persistence)

Driver constructor, just to ensure all pieces are in the right place

Composer
getComposer()

No description

IOInterface
getIo()

No description

Configuration
getConfiguration()

No description

void
install(string $package_name, string $package_path, array $package_extra)

Install a package, processing all extra fields that it contains.

void
update(string $package_name, string $package_path, array $initial_extra, array $target_extra)

Update a package checking differences from it's initial and target extra fields.

void
uninstall(string $package_name, string $package_path, array $package_extra)

Uninstall package, removing all related extra fields.

managePlugins($action, $config, $package_name, array $package_extra)

No description

static 
validate(array $extra)

No description

Details

__construct(Composer $composer, IOInterface $io, Configuration $configuration, InstallerParameters $parameters, InstallerPersistenceInterface $persistence)

Driver constructor, just to ensure all pieces are in the right place

Parameters

Composer $composer
IOInterface $io
Configuration $configuration
InstallerParameters $parameters
InstallerPersistenceInterface $persistence

Composer getComposer()

Return Value

Composer

IOInterface getIo()

Return Value

IOInterface

Configuration getConfiguration()

Return Value

Configuration

InstallerParameters getParameters()

Return Value

InstallerParameters

void install(string $package_name, string $package_path, array $package_extra)

Install a package, processing all extra fields that it contains.

Parameters

string $package_name
string $package_path
array $package_extra

Return Value

void

void update(string $package_name, string $package_path, array $initial_extra, array $target_extra)

Update a package checking differences from it's initial and target extra fields.

Parameters

string $package_name
string $package_path
array $initial_extra
array $target_extra

Return Value

void

void uninstall(string $package_name, string $package_path, array $package_extra)

Uninstall package, removing all related extra fields.

Parameters

string $package_name
string $package_path
array $package_extra

Return Value

void

protected managePlugins($action, $config, $package_name, array $package_extra)

Parameters

$action
$config
$package_name
array $package_extra

static protected validate(array $extra)

Parameters

array $extra