forked from devsecopsmaturitymodel/DevSecOps-MaturityModel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpToYml.php
More file actions
25 lines (23 loc) · 780 Bytes
/
phpToYml.php
File metadata and controls
25 lines (23 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
$files = scandir("data");
foreach ($files as $file) {
if (strlen($file) > 2) {
include_once "data/$file";
}
}
ksort($dimensions);
foreach ($dimensions as $dimensionName => $subDimension) {
ksort($subDimension);
foreach ($subDimension as $subDimensionName => $elements) {
$newElements = $elements;
ksort($newElements);
$dimensions[$dimensionName][$subDimensionName] = $newElements;
foreach($newElements as $element) {
if(array_key_exists("securityProperties", $element)){
unset($element['securityProperties']);// might work
}
}
}
$yml = yaml_emit($dimensions[$dimensionName]);
file_put_contents("data/" .str_replace(" ","", $dimensionName).".yml", $yml);
}