dbxapp
4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
dbxapp.de
Portal
Start
Anwender
Entwickler
KI-Bereiche
Loading...
Searching...
No Matches
dbxDd_trace_test.php
Go to the documentation of this file.
1
<?php
2
3
$root
= dirname(__DIR__, 2) . DIRECTORY_SEPARATOR .
'modules'
;
4
$files
= array();
5
$iterator
=
new
RecursiveIteratorIterator(
new
RecursiveDirectoryIterator(
$root
, FilesystemIterator::SKIP_DOTS));
6
foreach
(
$iterator
as
$file
) {
7
$path =
$file
->getPathname();
8
if
(!
$file
->isFile() || !str_ends_with(strtolower(
$file
->getFilename()),
'.dd.php'
)) {
9
continue
;
10
}
11
$normalized
= str_replace(
'\\'
,
'/'
, $path);
12
if
(strpos(
$normalized
,
'/dd/'
) ===
false
|| strpos(
$normalized
,
'/_backup/'
) !==
false
) {
13
continue
;
14
}
15
$files
[] = $path;
16
}
17
18
$errors
= array();
19
$checked
= 0;
20
foreach
(
$files
as
$file
) {
21
$table
= array();
22
$fields
= array();
23
$indexes
= array();
24
$__dbx_lng_dd
=
''
;
25
include
$file
;
26
27
if
(!array_key_exists(
'table'
,
$table
)) {
28
continue
;
29
}
30
$checked
++;
31
$datadic = trim((
string
)(
$table
[
'datadic'
] ??
''
));
32
$expected
= $datadic ===
'dbxUser'
?
'1'
:
'0'
;
33
$actual = (string)(
$table
[
'trace'
] ??
''
);
34
if
($actual !==
$expected
) {
35
$errors
[] = str_replace(
'\\'
,
'/'
, substr(
$file
, strlen(dirname(__DIR__, 2)) + 1))
36
.
' datadic='
. $datadic .
' trace='
. ($actual ===
''
?
'<fehlt>'
: $actual)
37
.
' erwartet='
.
$expected
;
38
}
39
}
40
41
if
(
$checked
=== 0 ||
$errors
) {
42
fwrite(STDERR,
$checked
=== 0
43
?
"Keine aktiven Tabellen-DDs gefunden.\n"
44
:
"Falsche Trace-Einstellung:\n - "
. implode(
"\n - "
,
$errors
) .
"\n"
);
45
exit
(1);
46
}
47
48
echo
"OK: {$checked} aktive Tabellen-DDs geprueft; nur dbxUser verwendet trace=1.\n"
;
49
$table
$table['server']
Definition
.dd.php:6
$indexes
$indexes[]
Definition
.dd.php:167
$__dbx_lng_dd
$__dbx_lng_dd
Definition
content_folder_de.dd.php:2
$iterator
$iterator
Definition
db_access_boundary_test.php:13
$root
$root
Definition
db_access_boundary_test.php:3
$errors
$errors
Definition
dbxAjax_submitter_test.php:31
$files
$files
Definition
dbxApi_paths_test.php:12
$checked
$checked
Definition
dbxDd_trace_test.php:19
$expected
foreach( $iterator as $file) if(! $groups) $expected
Definition
dbxForm_fd_language_messages_test.php:56
$fields
$fields
Definition
dbxForm_fd_language_messages_test.php:204
exit
exit
Definition
index.php:146
$file
$file
Definition
shop_repository_request_cache_test.php:3
$normalized
$normalized
Definition
workflow_roundtrip_test.php:213
dbx
include
tests
dbxDd_trace_test.php
Generated by
1.17.0