Skip to content

Internals Installer Package VersionCompare

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

installer\package\VersionCompare

Framework Internals · Subsystem overview · Developer guide

Source: awt_src/classes/installer/package/VersionCompare.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\IVersionCompare;

VersionCompare

Declaration and architectural role

class VersionCompare implements IVersionCompare

Constants, enum cases, traits and properties

No own constants, enum cases, traits or property declarations. Inherited members are documented on the parent reference page.

Method index

Method Signature
compare public function compare(string $old, string $new): int
compareCompatibility public function compareCompatibility(string $min, ?string $max = null): bool

compare

Source line 13

public function compare(string $old, string $new): int

Parameters

Parameter Type, modifiers and default Purpose
$old string $old Operation input; the exact use, validation and propagation are shown in the implementation trace.
$new string $new Operation input; the exact use, validation and propagation are shown in the implementation trace.

Return expressions (including local callbacks): version_compare($old, $new).

Implementation, validation guards and interaction order
/**
     * @inheritDoc
     */
    public function compare(string $old, string $new): int
    {
        return version_compare($old, $new);
    }

compareCompatibility

Source line 21

public function compareCompatibility(string $min, ?string $max = null): bool

Parameters

Parameter Type, modifiers and default Purpose
$min string $min Operation input; the exact use, validation and propagation are shown in the implementation trace.
$max ?string $max = null Operation input; the exact use, validation and propagation are shown in the implementation trace.

Return expressions (including local callbacks): version_compare(AWT_VERSION, $min, '>=') && (!$max || version_compare(AWT_VERSION, $max, '<=')).

Implementation, validation guards and interaction order
/**
     * @inheritDoc
     */
    public function compareCompatibility(string $min, ?string $max = null): bool
    {
        return version_compare(AWT_VERSION, $min, '>=') && (!$max || version_compare(AWT_VERSION, $max, '<='));
    }

Related types

Clone this wiki locally