dbxapp 4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
Loading...
Searching...
No Matches
dbxDocumentationGuides_contract_test.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
5$root = dirname(__DIR__, 3);
6
7$fail = static function (string $message, int $code): void {
8 fwrite(STDERR, "FAIL: {$message}\n");
9 exit($code);
10};
11
12$read = static function (string $relative) use ($root, $fail): string {
13 $file = $root . '/' . ltrim($relative, '/');
14 if (!is_file($file)) {
15 $fail('Dokumentationsquelle fehlt: ' . $relative, 1);
16 }
17 $content = file_get_contents($file);
18 if (!is_string($content) || trim($content) === '') {
19 $fail('Dokumentationsquelle ist leer: ' . $relative, 2);
20 }
21 return $content;
22};
23
24$version = trim($read('VERSION'));
25$main = $read('00_Doxygen_Mainpage.md');
26$installationReference = $read('27_Installation_Updates_DD_Serverbindungen.md');
27$portalReference = $read('29_Dokumentationsportal.md');
28$shopReference = $read('17_Shop_Leitfaden.md');
29$installation = $read('dbx/modules/dbxDocs/content/dbxapp_user_installation.html');
30$installationTutorial = $read('dbx/modules/dbxDocs/content/tutorial_installation.html');
31$selfTest = $read('dbx/modules/dbxDocs/content/dbxapp_user_selftest.html');
32$provisioner = $read('dbx/modules/dbxDocs/include/dbxDocsContentProvision.class.php');
33$selfTestRunner = $read('dbx/modules/dbxSelfTest/include/dbxSelfTestRunner.class.php');
34$doxyfile = $read('Doxyfile');
35
36if (!str_contains($main, '**Version:** ' . $version)) {
37 $fail('Die redaktionelle Hauptseite nennt nicht die Release-Version ' . $version . '.', 3);
38}
39if (!str_contains($doxyfile, 'PROJECT_NUMBER = "' . $version . '"')) {
40 $fail('Doxygen PROJECT_NUMBER stimmt nicht mit VERSION überein.', 4);
41}
42if (preg_match('#`admin`\s*/\s*`admin`#u', $installationReference) === 1) {
43 $fail('Die Installationsreferenz dokumentiert noch den entfernten Standardzugang admin/admin.', 5);
44}
45foreach (array(
46 'persönlichen Passwort',
47 'Schritt 5',
48 'dbxSelfTest',
49) as $needle) {
50 if (!str_contains($installationReference, $needle)) {
51 $fail('Aktueller Installationsvertrag fehlt: ' . $needle, 6);
52 }
53}
54foreach (array(
55 'PHP 8.2 oder neuer',
56 'Die sieben Installationsschritte',
57 'DB3 oder PDO?',
58 'config.local.php',
59 'persönlichen Passwort',
60 'dokumentation-selbsttest',
61 'dokumentation-system-update',
62) as $needle) {
63 if (!str_contains($installation, $needle)) {
64 $fail('Installationsanleitung ist unvollständig: ' . $needle, 7);
65 }
66}
67foreach (array(
68 'dbxapp Schritt für Schritt installieren',
69 'Systemvoraussetzungen prüfen',
70 'Die Datenbankverbindung schlägt fehl',
71 'Abnahmeprotokoll',
72 'dokumentation-selbsttest',
73) as $needle) {
74 if (!str_contains($installationTutorial, $needle)) {
75 $fail('Installations-Tutorial ist unvollständig: ' . $needle, 14);
76 }
77}
78foreach (array(
79 'Schnelltest',
80 'Kompletttest',
81 'Auswahl testen',
82 'Einzeltest',
83 'JavaScript ohne Node.js auf dem Webserver',
84 'files/sys/selftest',
85 '--profile=quick',
86 '--profile=full',
87 '--test=&lt;test-id&gt;',
88 'letzten 20 Läufe',
89) as $needle) {
90 if (!str_contains($selfTest, $needle)) {
91 $fail('SelfTest-Anleitung ist unvollständig: ' . $needle, 8);
92 }
93}
94foreach (array(
95 '2026-08-01-installation-2',
96 '2026-08-01-tutorial-installation-2',
97 '2026-08-01-selftest-2',
98 "'permalink' => 'dokumentation-installation'",
99 "'permalink' => 'tutorial-installation'",
100 "'permalink' => 'dokumentation-selbsttest'",
101 "'folder_key' => 'operations'",
102) as $needle) {
103 if (!str_contains($provisioner, $needle)) {
104 $fail('Reproduzierbare CMS-Provisionierung fehlt: ' . $needle, 9);
105 }
106}
107if (!str_contains($selfTestRunner, "version_compare(PHP_VERSION, '8.2.0', '<')")) {
108 $fail('dbxSelfTest und Installer verwenden nicht dieselbe PHP-Mindestversion.', 10);
109}
110$designTemplate = $read('dbx/design/dbxapp/htm/default.htm');
111if (preg_match('/core\.js\?[^"\']*v=(\d+)/', $designTemplate, $assetMatch) !== 1
112 || !str_contains($shopReference, 'dbxapp-Asset-Version ' . $assetMatch[1])) {
113 $fail('Der Shop-Leitfaden nennt nicht die aktuelle JavaScript-Asset-Version.', 13);
114}
115foreach (array('reference\\archive', 'provision_docs_content.php', 'dbxSelfTest') as $needle) {
116 if (!str_contains($portalReference, $needle)) {
117 $fail('Betriebsanleitung des Dokumentationsportals ist unvollständig: ' . $needle, 11);
118 }
119}
120
121foreach (array('Installation' => $installation, 'Installations-Tutorial' => $installationTutorial, 'SelfTest' => $selfTest) as $label => $html) {
122 $previous = libxml_use_internal_errors(true);
123 $dom = new DOMDocument('1.0', 'UTF-8');
124 $loaded = $dom->loadHTML(
125 '<?xml encoding="UTF-8"><!doctype html><html><body>' . $html . '</body></html>',
126 LIBXML_NONET | LIBXML_NOERROR | LIBXML_NOWARNING
127 );
128 libxml_clear_errors();
129 libxml_use_internal_errors($previous);
130 if (!$loaded
131 || $dom->getElementsByTagName('h1')->length !== 1
132 || $dom->getElementsByTagName('h2')->length < 5
133 || $dom->getElementsByTagName('h3')->length < 1) {
134 $fail($label . '-Anleitung ist kein vollständiges, parsebares HTML-Dokument.', 12);
135 }
136}
137
138echo "OK installation and dbxSelfTest guides match release {$version}\n";
if(!str_contains($main, ' **Version:**' . $version)) if(!str_contains( $doxyfile, 'PROJECT_NUMBER="' . $version . '"')) if(preg_match('#`admin`\s */\s *`admin`#u', $installationReference)===1) foreach(array( 'persönlichen Passwort', 'Schritt 5', 'dbxSelfTest',) as $needle) foreach(array('PHP 8.2 oder neuer', 'Die sieben Installationsschritte', 'DB3 oder PDO?', 'config.local.php', 'persönlichen Passwort', 'dokumentation-selbsttest', 'dokumentation-system-update',) as $needle) foreach(array( 'dbxapp Schritt für Schritt installieren', 'Systemvoraussetzungen prüfen', 'Die Datenbankverbindung schlägt fehl', 'Abnahmeprotokoll', 'dokumentation-selbsttest',) as $needle) foreach(array('Schnelltest', 'Kompletttest', 'Auswahl testen', 'Einzeltest', 'JavaScript ohne Node.js auf dem Webserver', 'files/sys/selftest', '--profile=quick', '--profile=full', '--test=&lt;test-id &gt;', 'letzten 20 Läufe',) as $needle) foreach(array( '2026-08-01-installation-2', '2026-08-01-tutorial-installation-2', '2026-08-01-selftest-2', "'permalink' => 'dokumentation-installation'", "'permalink' => 'tutorial-installation'", "'permalink' => 'dokumentation-selbsttest'", "'folder_key' => 'operations'",) as $needle) if(!str_contains($selfTestRunner, "version_compare(PHP_VERSION, '8.2.0', '<')") $designTemplate)
exit
Definition index.php:146