Skip to content
docs

PluginInstallerInterface

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

PluginInstallerInterface::require()

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

Install a plugin from a remote source (GitHub).

Parameters

Parámetros de require()
NombreTipoDescripción
$sourcestring"owner/repo", "owner/repo:^2.0", or full GitHub URL

Throws

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

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

PluginInstallerInterface::update()

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

Update an installed plugin to the latest compatible version.

Parameters

Parámetros de update()
NombreTipoDescripción
$pluginNamestring
$targetVersion?string

Throws

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

PluginInstallerInterface::resolve()

abstract public function resolve(string $source): Milpa\app\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

Parámetros de resolve()
NombreTipoDescripción
$sourcestring"owner/repo", "owner/repo:^2.0", or full GitHub URL

PluginInstallerInterface::remove()

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

Remove a remotely-installed plugin.

Parameters

Parámetros de remove()
NombreTipoDescripción
$pluginNamestring
$keepDatabool