Skip to content

Internals Installer Package PrepareInstallation

Stefan Crkvenjakov edited this page Oct 7, 2026 · 1 revision

installer\package\PrepareInstallation

Framework Internals · Subsystem overview · Developer guide

Source: awt_src/classes/installer/package/PrepareInstallation.php · Snapshot 8411f4287706.

Installation validates archives and manifests, moves files, persists metadata, copies data into storage, invokes an optional hook and emits an event. These operations do not form one atomic transaction.

Imports and dependencies

use installer\interfaces\package\IPrepareInstallation;
use installer\interfaces\package\IVerifyManifest;
use installer\interfaces\package\IVerifyStructure;

PrepareInstallation

Declaration and architectural role

readonly class PrepareInstallation implements IPrepareInstallation

Constants, enum cases, traits and properties

Declarations below preserve visibility, type, default and modifiers exactly. A typed property without an initializer remains uninitialized until its constructor or another method assigns it. Mutable fields belong to this instance unless marked static; readonly fields can be initialized once. Constructor-promoted properties are also listed below.

Member Declaration Purpose or source contract
Constructor-promoted private IVerifyManifest $manifestVerifier Initialized from the constructor argument; default expression is evaluated when the argument is omitted.
Constructor-promoted private IVerifyStructure $structureVerifier Initialized from the constructor argument; default expression is evaluated when the argument is omitted.

Method index

Method Signature
__construct public function __construct( private IVerifyManifest $manifestVerifier, private IVerifyStructure $structureVerifier, )
prepare public function prepare(): IPrepareInstallation
verify public function verify(): bool

__construct

Source line 12

public function __construct(
        private IVerifyManifest $manifestVerifier,
        private IVerifyStructure $structureVerifier,
    );

Parameters

Parameter Type, modifiers and default Purpose
$manifestVerifier private IVerifyManifest $manifestVerifier Operation input; the exact use, validation and propagation are shown in the implementation trace.
$structureVerifier private IVerifyStructure $structureVerifier Operation input; the exact use, validation and propagation are shown in the implementation trace.

Concrete no-op/default hook: this method performs no work. Override it where the lifecycle or extension contract calls for behavior.

prepare

Source line 20

public function prepare(): IPrepareInstallation

Return expressions (including local callbacks): $this.

Implementation, validation guards and interaction order
/**
     * @inheritDoc
     */
    public function prepare(): IPrepareInstallation
    {
        $this->manifestVerifier
            ->addKey("name")
            ->addKey("version")
            ->addKey("type")
            ->addKey("minimum_awt_version");

        $this->structureVerifier
            ->addFile("main.php");

        return $this;
    }

verify

Source line 37

public function verify(): bool

Return expressions (including local callbacks): false; $this->manifestVerifier->verify().

Implementation, validation guards and interaction order
/**
     * @inheritDoc
     */
    public function verify(): bool
    {
        $res = $this->structureVerifier->verify();
        if (!$res) {
            return false;
        }
        return $this->manifestVerifier->verify();
    }

Related types

Clone this wiki locally