Skip to content
docsv0.8.0

PluginInstallerInterface

Installs, updates, and removes plugins from remote sources (GitHub).

PluginInstallerInterface::require()

abstract public function require(string $source): Milpa\DTO\PluginInstallResult

Install a plugin from a remote source (GitHub).

Parameters

Parameters of require()
NameTypeDescription
$sourcestring"owner/repo", "owner/repo:^2.0", or full GitHub URL

Throws

\Milpa\Exceptions\Plugin\PluginInstallException If the plugin fails to install.

\Milpa\Exceptions\Plugin\PluginDependencyException If a required dependency is unmet.

PluginInstallerInterface::update()

abstract public function update(string $pluginName, ?string $targetVersion = null): Milpa\DTO\PluginInstallResult

Update an installed plugin to the latest compatible version.

Parameters

Parameters of update()
NameTypeDescription
$pluginNamestring
$targetVersion?string

Throws

\Milpa\Exceptions\Plugin\PluginInstallException If the plugin fails to update.

PluginInstallerInterface::resolve()

abstract public function resolve(string $source): Milpa\DTO\DependencyResolution

Resolve plugin and Composer dependencies for a remote source without installing it. Downloads the candidate release, reads its manifest, and checks it against currently-installed plugins — the same resolution `require()` performs internally before it commits any files or DB state.

Parameters

Parameters of resolve()
NameTypeDescription
$sourcestring"owner/repo", "owner/repo:^2.0", or full GitHub URL

PluginInstallerInterface::remove()

abstract public function remove(string $pluginName, bool $keepData = false): Milpa\DTO\PluginRemoveResult

Remove a remotely-installed plugin.

Parameters

Parameters of remove()
NameTypeDescription
$pluginNamestring
$keepDatabool