Skip to content
Viames Marino edited this page Feb 23, 2026 · 1 revision

Pair framework: Plugin

Pair\Helpers\Plugin manages plugin package lifecycle: download, extract, parse, and install.

When to use

Use Plugin when installing/updating module/template packages that follow Pair plugin manifest conventions.

Main methods

  • installPackage(string $package): bool
  • downloadPackage(): void
  • createManifestFile(): bool
  • __get(...), __set(...) for plugin metadata access

Implementation examples

Local package install

$plugin = new \Pair\Helpers\Plugin();

if (!$plugin->installPackage('my-module.zip')) {
    throw new RuntimeException('Plugin installation failed');
}

Remote download + install flow

$plugin = new \Pair\Helpers\Plugin();
$plugin->name = 'my-module';
$plugin->version = '1.2.0';
$plugin->downloadPackage();

$ok = $plugin->installPackage('my-module-1.2.0.zip');

Common pitfalls

  • Invalid manifest structure leads to partial installation.
  • Version compatibility should be checked before activation.

See also: PluginBase, Module, Template.

Clone this wiki locally