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. | |
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.
| 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.
| 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.
Definition at line 663 of file dbxUpdateService.class.php.
References $state.
| dbx\dbxAdmin\dbxUpdateService::check | ( | bool | $force = false | ) |
Fetches and validates the trusted stable release manifest.
Definition at line 131 of file dbxUpdateService.class.php.
References $cached, $force, $json, $manifest, and validateManifest().
|
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().
| dbx\dbxAdmin\dbxUpdateService::inspectPackage | ( | string | $zipFile, |
| array | $manifest ) |
Validates ZIP paths, symlinks, inventory and package hashes.
| string | $zipFile | Absolute path of the downloaded release ZIP. |
| array | $manifest | Already downloaded release metadata. |
Definition at line 356 of file dbxUpdateService.class.php.
References $content, $files, $index, $manifest, $required, $version, $zipFile, and validateManifest().
| dbx\dbxAdmin\dbxUpdateService::install | ( | ) |
Installs the staged package with a complete changed-file backup.
Definition at line 476 of file dbxUpdateService.class.php.
| 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().
Definition at line 166 of file dbxUpdateService.class.php.
| dbx\dbxAdmin\dbxUpdateService::rollback | ( | ) |
Restores the complete changed-file backup of the last installation.
Definition at line 679 of file dbxUpdateService.class.php.
| dbx\dbxAdmin\dbxUpdateService::stage | ( | array | $manifest = array() | ) |
Downloads, hashes and extracts the newest release into isolated staging.
Definition at line 256 of file dbxUpdateService.class.php.
References $manifest, check(), and validateManifest().
Referenced by prepare().
| 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.
Definition at line 99 of file dbxUpdateService.class.php.
References $cached, $installed, and $manifest.
| dbx\dbxAdmin\dbxUpdateService::validateManifest | ( | array | $manifest | ) |
Validates the release contract and its fixed GitHub trust boundary.
| array | $manifest | Release metadata to validate. |
Definition at line 187 of file dbxUpdateService.class.php.
References $base, $extensions, $manifest, and $version.
Referenced by check(), inspectPackage(), and stage().