dbxapp 4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
Loading...
Searching...
No Matches
dbxLegacyInstallConfig_test.php
Go to the documentation of this file.
1<?php
2
3require_once dirname(__DIR__, 2) . '/vendor/autoload.php';
4require_once dirname(__DIR__) . '/dbxKernel.php';
5
6$fail = static function (string $message, int $code): void {
7 fwrite(STDERR, "FAIL: $message\n");
8 exit($code);
9};
10
11$localFile = tempnam(sys_get_temp_dir(), 'dbx-install-config-');
12if (!is_string($localFile) || $localFile === '') {
13 $fail('Temporäre lokale Konfiguration konnte nicht erstellt werden.', 1);
14}
15
16try {
17 $method = new ReflectionMethod(dbxApi::class, 'normalize_legacy_install_config');
18 $api = dbx();
19
20 $legacy = $method->invoke($api, 'dbx', $localFile, array());
21 if (($legacy['install'] ?? null) !== 0) {
22 $fail('Bestehende Legacy-Installation wird nicht als installiert erkannt.', 2);
23 }
24
25 $explicitInstaller = $method->invoke($api, 'dbx', $localFile, array('install' => 1));
26 if (($explicitInstaller['install'] ?? null) !== 1) {
27 $fail('Expliziter lokaler Installationsmodus wird überschrieben.', 3);
28 }
29
30 $otherModule = $method->invoke($api, 'dbxLogin', $localFile, array());
31 if (array_key_exists('install', $otherModule)) {
32 $fail('Kompatibilitätsregel greift außerhalb des Kernmoduls.', 4);
33 }
34
35 $missingFile = $method->invoke($api, 'dbx', $localFile . '.missing', array());
36 if (array_key_exists('install', $missingFile)) {
37 $fail('Neuinstallation ohne lokale Konfiguration wird übersprungen.', 5);
38 }
39} finally {
40 if (is_file($localFile)) {
41 unlink($localFile);
42 }
43}
44
45echo "OK legacy install configuration compatibility (4)\n";
if(array_key_exists('install', $otherModule)) $missingFile
if(($legacy['install'] ?? null) !==0) $explicitInstaller
if(($explicitInstaller['install'] ?? null) !==1) $otherModule
exit
Definition index.php:146
DBX schema administration.