-
Notifications
You must be signed in to change notification settings - Fork 2
InstallablePackage
Viames Marino edited this page Apr 28, 2026
·
2 revisions
Pair\Packages\InstallablePackage manages ZIP package lifecycle: manifest creation, archive download, archive validation, file installation, and package record creation.
The official name for this extension style is Installable Package.
This is the ZIP/manifest package installer surface. Runtime Extensions should use RuntimeExtensionInterface and explicit registration instead.
Use InstallablePackage when installing or downloading module, template, provider, or custom packages that follow Pair manifest conventions.
installArchive(string $archivePath): booldownloadArchive(): voidwriteManifestFile(): bool-
__get(...),__set(...)for package metadata access
$package = new \Pair\Packages\InstallablePackage();
if (!$package->installArchive('my-module.zip')) {
throw new \RuntimeException('Package installation failed');
}$package = new \Pair\Packages\InstallablePackage();
$package->name = 'my-module';
$package->version = '1.2.0';
$package->downloadArchive();
$ok = $package->installArchive('my-module-1.2.0.zip');$package = new \Pair\Packages\InstallablePackage(
'Module',
'customer-portal',
'1.2.0',
'2026-04-23',
'4.0',
APPLICATION_PATH . '/modules/customer-portal'
);
if (!$package->writeManifestFile()) {
throw new \RuntimeException('Package manifest could not be written.');
}- Invalid manifest structure leads to partial installation.
- Version compatibility should be checked before activation.
See also: RuntimeExtensionInterface, AdapterRegistry, InstallablePackageRecord, Module, Template.