class CommandDriver extends AbstractDriver (View source)

Installer driver to process command line commands

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

"extra": { "commands": [ { "class": "\My\Command", "scope": "dispatcher" // <= this command will be loaded by dispatcher exec only }, { "class": "\My\Command", "scope": "extender" // <= this command will be loaded by extender exec only }, { "class": "\My\Command" // <= this command will be loaded by every exec }, { "class": "\My\Command", "scope": "any" // <= this command will be loaded by every exec } ] }

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_cmd Basic command 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.

manageCommands($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 manageCommands($action, $config, $package_name, array $package_extra)

Parameters

$action
$config
$package_name
array $package_extra

static protected validate(array $extra)

Parameters

array $extra