dbxapp
4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
dbxapp.de
Portal
Start
Anwender
Entwickler
KI-Bereiche
Loading...
Searching...
No Matches
dbxUpdateMigrationBootstrap_contract_test.php
Go to the documentation of this file.
1
<?php
2
3
declare(strict_types=1);
4
5
$root
= dirname(__DIR__, 4);
6
$errors
= array();
7
$checked
= 0;
8
9
foreach
(glob(
$root
.
'/dbx/modules/*/migrations/*.migration.php'
) ?: array() as
$migrationFile
) {
10
$migration
= include
$migrationFile
;
11
if
(!is_array(
$migration
)) {
12
$errors
[] =
'Ungültige Migration: '
.
$migrationFile
;
13
continue
;
14
}
15
foreach
((array)(
$migration
[
'affected_dd'
] ?? array()) as $ddRef) {
16
$parts = explode(
'|'
, (
string
)$ddRef, 2);
17
if
(count($parts) !== 2) {
18
$errors
[] =
'Ungültige DD-Referenz: '
. (string)$ddRef;
19
continue
;
20
}
21
[
$module
,
$dd
] = $parts;
22
$ddFile =
$root
.
'/dbx/modules/'
.
$module
.
'/dd/'
.
$dd
.
'.dd.php'
;
23
if
(!is_file($ddFile)) {
24
continue
;
25
}
26
$table
= (
static
function
(
string
$file
): array {
27
$table
= array();
28
$fields
= array();
29
$indexes
= array();
30
include
$file
;
31
return
is_array(
$table
) ?
$table
: array();
32
})($ddFile);
33
$server
= trim((
string
)(
$table
[
'server'
] ??
''
));
34
if
(preg_match(
'/\.(?:db3|sqlite|sqlite3)$/i'
,
$server
) !== 1) {
35
continue
;
36
}
37
$checked
++;
38
if
(!str_starts_with(
$server
,
$module
.
'|'
)) {
39
$errors
[] = $ddRef .
' verwendet keinen releasefest qualifizierten SQLite-Server: '
.
$server
;
40
}
41
}
42
}
43
44
if
(
$checked
=== 0) {
45
$errors
[] =
'Kein migrationsbetroffener SQLite-DD-Server geprüft.'
;
46
}
47
if
(
$errors
!== array()) {
48
fwrite(STDERR,
"FAIL\n- "
. implode(
"\n- "
,
$errors
) .
"\n"
);
49
exit
(1);
50
}
51
52
echo
'OK migration bootstrap uses release-stable SQLite server references ('
.
$checked
.
")\n"
;
$table
$table['server']
Definition
.dd.php:6
$indexes
$indexes[]
Definition
.dd.php:167
$root
$root
Definition
db_access_boundary_test.php:3
$errors
$errors
Definition
dbxAjax_submitter_test.php:31
$migrationFile
$migrationFile
Definition
dbxContentMarketingDeMigration_test.php:22
$server
$server
Definition
dbxDB_dynamic_reconnect_test.php:20
$module
$module
Definition
dbxDashboard_default_admin_warning_test.php:5
$checked
$checked
Definition
dbxDd_trace_test.php:19
$fields
$fields
Definition
dbxForm_fd_language_messages_test.php:204
$migration
$migration
Definition
dbxMediaUsageLanguage_contract_test.php:17
$dd
$dd
Definition
dbxMediaUsageLanguage_contract_test.php:10
exit
exit
Definition
index.php:146
$file
$file
Definition
shop_repository_request_cache_test.php:3
dbx
modules
dbxAdmin
tests
dbxUpdateMigrationBootstrap_contract_test.php
Generated by
1.17.0