dbxapp 4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
Loading...
Searching...
No Matches
dbx\dbxAdmin\dbxUpdateService Class Reference

Sicherer dbxApp Release-Updater fuer Dateien und optionale DB-Migrationen. More...

Public Member Functions

 __construct (string $root='', string $manifestUrl='', int $cacheTtl=21600, ?object $databaseAdapter=null)
 status ()
 Returns current, cached and staged update information.
 check (bool $force=false)
 Fetches and validates the trusted stable release manifest.
 prepare ()
 Performs the complete non-destructive part of an update in one step.
 validateManifest (array $manifest)
 Validates the release contract and its fixed GitHub trust boundary.
 stage (array $manifest=array())
 Downloads, hashes and extracts the newest release into isolated staging.
 inspectPackage (string $zipFile, array $manifest)
 Validates ZIP paths, symlinks, inventory and package hashes.
 install ()
 Installs the staged package with a complete changed-file backup.
 cancel ()
 Stops a prepared update before program files are changed.
 rollback ()
 Restores the complete changed-file backup of the last installation.

Static Public Member Functions

static configured ()
 Creates the centrally configured updater used by all admin surfaces.

Detailed Description

Sicherer dbxApp Release-Updater fuer Dateien und optionale DB-Migrationen.

Runtime-Daten und lokale Konfiguration bleiben aus Paketen ausgeschlossen. Datenbankarbeit wird ausschliesslich an den zentralen DD/dbxDB-Adapter delegiert und gemeinsam mit dem Datei-Backup zurueckgerollt.

Definition at line 18 of file dbxUpdateService.class.php.

Constructor & Destructor Documentation

◆ __construct()

dbx\dbxAdmin\dbxUpdateService::__construct ( string $root = '',
string $manifestUrl = '',
int $cacheTtl = 21600,
?object $databaseAdapter = null )

Definition at line 34 of file dbxUpdateService.class.php.

References $method.

Member Function Documentation

◆ cancel()

dbx\dbxAdmin\dbxUpdateService::cancel ( )

Stops a prepared update before program files are changed.

The verified ZIP, extracted staging directory and staged state are removed together. Cached release information and rollback backups remain untouched.

Returns
array<string,mixed>

Definition at line 663 of file dbxUpdateService.class.php.

References $state.

◆ check()

dbx\dbxAdmin\dbxUpdateService::check ( bool $force = false)

Fetches and validates the trusted stable release manifest.

Returns
array<string,mixed>

Definition at line 131 of file dbxUpdateService.class.php.

References $cached, $force, $json, $manifest, and validateManifest().

Referenced by prepare(), and stage().

◆ configured()

dbx\dbxAdmin\dbxUpdateService::configured ( )
static

Creates the centrally configured updater used by all admin surfaces.

The update page and the dashboard must use the same manifest URL and cache lifetime. Keeping that wiring here prevents separate update implementations and leaves the service directly constructible in tests.

Definition at line 72 of file dbxUpdateService.class.php.

References $config.

Referenced by dbx\dbxAdmin\dbxUpdate\run().

◆ inspectPackage()

dbx\dbxAdmin\dbxUpdateService::inspectPackage ( string $zipFile,
array $manifest )

Validates ZIP paths, symlinks, inventory and package hashes.

Parameters
string$zipFileAbsolute path of the downloaded release ZIP.
array$manifestAlready downloaded release metadata.
Returns
array{files:array<int,string>,hashes:array<string,string>}

Definition at line 356 of file dbxUpdateService.class.php.

References $content, $files, $index, $manifest, $required, $version, $zipFile, and validateManifest().

◆ install()

dbx\dbxAdmin\dbxUpdateService::install ( )

Installs the staged package with a complete changed-file backup.

Returns
array<string,mixed>

Definition at line 476 of file dbxUpdateService.class.php.

◆ prepare()

dbx\dbxAdmin\dbxUpdateService::prepare ( )

Performs the complete non-destructive part of an update in one step.

A user action checks the latest stable release, downloads it when it is newer, validates the package and prepares it in the isolated staging directory. Program files are not changed by this method. The user can therefore either call install() or safely discard everything with cancel().

Returns
array<string,mixed>

Definition at line 166 of file dbxUpdateService.class.php.

References $manifest, $state, check(), and stage().

◆ rollback()

dbx\dbxAdmin\dbxUpdateService::rollback ( )

Restores the complete changed-file backup of the last installation.

Returns
array<string,mixed>

Definition at line 679 of file dbxUpdateService.class.php.

◆ stage()

dbx\dbxAdmin\dbxUpdateService::stage ( array $manifest = array())

Downloads, hashes and extracts the newest release into isolated staging.

Returns
array<string,mixed>

Definition at line 256 of file dbxUpdateService.class.php.

References $manifest, check(), and validateManifest().

Referenced by prepare().

◆ status()

dbx\dbxAdmin\dbxUpdateService::status ( )

Returns current, cached and staged update information.

This method performs file reads only. It never opens a network connection, which makes it safe for menus and dashboards.

Returns
array<string,mixed>

Definition at line 99 of file dbxUpdateService.class.php.

References $cached, $installed, and $manifest.

◆ validateManifest()

dbx\dbxAdmin\dbxUpdateService::validateManifest ( array $manifest)

Validates the release contract and its fixed GitHub trust boundary.

Parameters
array$manifestRelease metadata to validate.
Returns
array<string,mixed>

Definition at line 187 of file dbxUpdateService.class.php.

References $base, $extensions, $manifest, and $version.

Referenced by check(), inspectPackage(), and stage().


The documentation for this class was generated from the following file: