dbxapp
4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
dbxapp.de
Portal
Start
Anwender
Entwickler
KI-Bereiche
Loading...
Searching...
No Matches
template_hygiene_test.php
Go to the documentation of this file.
1
<?php
2
3
$root
= dirname(__DIR__, 3);
4
$failures
= array();
5
$iterator
=
new
RecursiveIteratorIterator(
6
new
RecursiveDirectoryIterator(
$root
.
'/dbx'
, FilesystemIterator::SKIP_DOTS)
7
);
8
9
foreach
(
$iterator
as
$file
) {
10
if
(!
$file
->isFile() || strtolower(
$file
->getExtension()) !==
'htm'
) {
11
continue
;
12
}
13
$path =
$file
->getRealPath();
14
$normalized
= str_replace(
'\\'
,
'/'
, $path ?:
''
);
15
if
(strpos(
$normalized
,
'/vendor/'
) !==
false
) {
16
continue
;
17
}
18
$source
= file_get_contents($path);
19
if
(!is_string(
$source
)) {
20
continue
;
21
}
22
$issues = array();
23
if
(strncmp(
$source
,
"\xEF\xBB\xBF"
, 3) === 0) {
24
$issues[] =
'UTF-8-BOM'
;
25
}
26
if
(preg_match(
'/\son[a-z]+\s*=/i'
,
$source
) === 1) {
27
$issues[] =
'Inline-Eventhandler'
;
28
}
29
if
($issues) {
30
$failures
[] = str_replace(
'\\'
,
'/'
, substr($path, strlen(
$root
) + 1)) .
' ('
. implode(
', '
, $issues) .
')'
;
31
}
32
}
33
34
if
(
$failures
) {
35
fwrite(STDERR,
"FAIL: Template-Hygiene: "
. implode(
', '
,
$failures
) .
"\n"
);
36
exit
(1);
37
}
38
39
echo
"OK template hygiene\n"
;
$iterator
$iterator
Definition
db_access_boundary_test.php:13
$root
$root
Definition
db_access_boundary_test.php:3
$failures
$failures
Definition
db_access_boundary_test.php:5
$source
$source
Definition
dbxCmsEditorPerformance_contract_test.php:4
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
template_hygiene_test.php
Generated by
1.17.0