dbxapp 4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
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));
6foreach ($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();
20foreach ($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
41if ($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
48echo "OK: {$checked} aktive Tabellen-DDs geprueft; nur dbxUser verwendet trace=1.\n";
49
$table['server']
Definition .dd.php:6
$indexes[]
Definition .dd.php:167
foreach( $iterator as $file) if(! $groups) $expected
exit
Definition index.php:146