PluginInstaller
Plugin install/update/remove pipeline, port-shaped: the source of the code speaks {@see PluginDownloaderInterface}, the activation store speaks {@see PluginRegistryInterface}, migrations run through the v2 {@see PluginMigrationRunner}, and composer requires go through {@see ComposerRunnerInterface} — a failed or invalid package spec ABORTS the installation (never the legacy log-and-continue).
PluginInstaller::__construct()
public function __construct(Milpa\Interfaces\Di\DIContainerInterface $container, Milpa\Plugin\Contracts\PluginRegistryInterface $registry, Milpa\Plugin\PluginMigrationRunner $migrationRunner, Milpa\Plugin\Contracts\ComposerRunnerInterface $composerRunner, Milpa\Plugin\Contracts\PluginDownloaderInterface $downloader, Milpa\Plugin\DependencyResolver $resolver, Milpa\Plugin\LockFileManager $lockManager, string $rootPath):Parameters
| Name | Type | Description |
|---|---|---|
| $container | Milpa\Interfaces\Di\DIContainerInterface | |
| $registry | Milpa\Plugin\Contracts\PluginRegistryInterface | |
| $migrationRunner | Milpa\Plugin\PluginMigrationRunner | |
| $composerRunner | Milpa\Plugin\Contracts\ComposerRunnerInterface | |
| $downloader | Milpa\Plugin\Contracts\PluginDownloaderInterface | |
| $resolver | Milpa\Plugin\DependencyResolver | |
| $lockManager | Milpa\Plugin\LockFileManager | |
| $rootPath | string |
PluginInstaller::setOutputCallback()
public function setOutputCallback(callable $callback): voidSet a callback for output messages during installation.
Parameters
| Name | Type | Description |
|---|---|---|
| $callback | callable(string $message, string $type): void |
PluginInstaller::require()
public function require(string $source): Milpa\DTO\PluginInstallResultInstall a plugin from a remote source (GitHub). Flow: 1. Parse source → owner, repo, constraint 2. Query GitHub API → find matching release 3. Download and extract zipball 4. Read milpa.json → validate 5. Resolve dependencies (Composer + plugins) 6. Install Composer packages through the composer port — a failed or invalid package spec ABORTS before any file or registry change 7. Copy to plugins/ directory 8. Register in the activation store + run install() 9. Run migrations 10. Update milpa.lock
Parameters
| Name | Type | Description |
|---|---|---|
| $source | string |
PluginInstaller::update()
public function update(string $pluginName, ?string $targetVersion = null): Milpa\DTO\PluginInstallResultUpdate an installed plugin to the latest compatible version.
Parameters
| Name | Type | Description |
|---|---|---|
| $pluginName | string | |
| $targetVersion | ?string |
PluginInstaller::resolve()
public function resolve(string $source): Milpa\DTO\DependencyResolutionResolve plugin and Composer dependencies for a remote source without installing it. Mirrors steps 1-5 of {@see require()} (parse source, resolve version, download, read manifest, resolve dependencies) but never copies files, touches the activation store, or updates milpa.lock — the extracted download is always cleaned up before returning.
Parameters
| Name | Type | Description |
|---|---|---|
| $source | string |
PluginInstaller::remove()
public function remove(string $pluginName, bool $keepData = false): Milpa\DTO\PluginRemoveResultRemove a remotely-installed plugin.
Parameters
| Name | Type | Description |
|---|---|---|
| $pluginName | string | |
| $keepData | bool |
PluginInstaller::checkOutdated()
public function checkOutdated(): arrayCheck if updates are available for installed remote plugins.