dbxapp 4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
Loading...
Searching...
No Matches
dbxDashboard_error_log_contract_test.php
Go to the documentation of this file.
1<?php
5
6$moduleDir = dirname(__DIR__);
7$dashboard = (string)file_get_contents(
8 $moduleDir . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'dbxDashboard.class.php'
9);
10$sysMsg = (string)file_get_contents(
11 $moduleDir . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'dbxSysMsg.class.php'
12);
13$template = (string)file_get_contents(
14 $moduleDir . DIRECTORY_SEPARATOR . 'tpl' . DIRECTORY_SEPARATOR . 'htm'
15 . DIRECTORY_SEPARATOR . 'admin-dashboard-error-log.htm'
16);
17$css = (string)file_get_contents(
18 $moduleDir . DIRECTORY_SEPARATOR . 'tpl' . DIRECTORY_SEPARATOR . 'css'
19 . DIRECTORY_SEPARATOR . 'admin-dashboard.css'
20);
21
23 "healthPercent = 0",
24 "'health_error_log'",
25 "dbx()->action_url(",
26 "dbx_do=delete_error_log&rid=error_log",
27 "htmlspecialchars(",
28 "ENT_QUOTES | ENT_SUBSTITUTE",
29 "admin-dashboard-status",
30);
31foreach ($requiredDashboardParts as $part) {
32 if (strpos($dashboard, $part) === false) {
33 fwrite(STDERR, "Dashboard-Fehlerlog-Vertrag fehlt: {$part}\n");
34 exit(1);
35 }
36}
37
39 "public function get_error_log_file(): string",
40 "dbx()->get_file_dir() . 'dbxError.log'",
41 "public function error_log_exists(): bool",
42 "public function delete_error_log(): string",
43 "@unlink(\$file)",
44 "clearstatcache(true, \$file)",
45);
46foreach ($requiredServiceParts as $part) {
47 if (strpos($sysMsg, $part) === false) {
48 fwrite(STDERR, "Zentraler Fehlerlog-Servicevertrag fehlt: {$part}\n");
49 exit(1);
50 }
51}
52
53if (strpos($sysMsg, "get_modul_var('file'") !== false) {
54 fwrite(STDERR, "Der Fehlerlog-Pfad darf nicht aus Request-Daten stammen.\n");
55 exit(1);
56}
57
58foreach (array(
59 'dbx-admin-dashboard-error-log-content',
60 'dbxConfirm',
61 'data-confirm-buttons="yesno"',
62 '{delete_action}',
63 '{content}',
64) as $part) {
65 if (strpos($template, $part) === false) {
66 fwrite(STDERR, "Fehlerlog-Templatevertrag fehlt: {$part}\n");
67 exit(1);
68 }
69}
70
71foreach (array(
72 '.dbx-admin-dashboard-health.is-error',
73 '.dbx-admin-dashboard-error-log-content',
74 'max-height: 320px',
75 'overflow: auto',
76 'resize: vertical',
77) as $part) {
78 if (strpos($css, $part) === false) {
79 fwrite(STDERR, "Fehlerlog-CSS-Vertrag fehlt: {$part}\n");
80 exit(1);
81 }
82}
83
84$loadMessages = static function (string $file): array {
85 $messages = array();
86 $fields = array();
87 include $file;
88 return $messages;
89};
90
91$fdDir = $moduleDir . DIRECTORY_SEPARATOR . 'fd' . DIRECTORY_SEPARATOR;
93 'de' => $loadMessages($fdDir . 'admin-dashboard-status.fd.php'),
94 'en' => $loadMessages($fdDir . 'admin-dashboard-status_en.fd.php'),
95 'es' => $loadMessages($fdDir . 'admin-dashboard-status_es.fd.php'),
96);
97$referenceKeys = array_keys($messageSets['de']);
98sort($referenceKeys);
99
100foreach ($messageSets as $language => $messages) {
101 $keys = array_keys($messages);
102 sort($keys);
103 if ($keys !== $referenceKeys) {
104 fwrite(STDERR, "FD-Schlüssel weichen für {$language} ab.\n");
105 exit(1);
106 }
107
108 foreach (array(
109 'health_error',
110 'error_log_title',
111 'error_log_delete_confirm',
112 'error_log_deleted',
113 'error_log_delete_error',
114 ) as $key) {
115 if (trim((string)($messages[$key] ?? '')) === '') {
116 fwrite(STDERR, "FD-Meldung {$key} fehlt für {$language}.\n");
117 exit(1);
118 }
119 }
120}
121
122echo "OK: Dashboard-Fehlerstatus, sicherer Log-Scroller, zentrale Löschung und Sprach-FDs\n";
$messages
Definition config.fd.php:2
foreach(array('bootstrapRowColumns', 'setBootstrapColumnLayout', 'addBootstrapColumn', 'dissolveBootstrapColumns',) as $function) $keys
$moduleDir
Architekturvertrag für die Fehlerprotokoll-Anzeige im Admin-Dashboard.
foreach($requiredDashboardParts as $part) $requiredServiceParts
foreach( $requiredServiceParts as $part) if(strpos($sysMsg, "get_modul_var('file'") !==false) foreach(array( 'dbx-admin-dashboard-error-log-content', 'dbxConfirm', 'data-confirm-buttons="yesno"', '{delete_action}', '{content}',) as $part) foreach(array('.dbx-admin-dashboard-health.is-error', '.dbx-admin-dashboard-error-log-content', 'max-height:320px', 'overflow:auto', 'resize:vertical',) as $part) $loadMessages
exit
Definition index.php:146