Adding config2json
Publish PHP Package / docker (push) Successful in 7s Details

This commit is contained in:
Pavel Shevaev 2025-02-27 20:00:38 +03:00
parent a15f4f935e
commit 458b72e367
1 changed files with 10 additions and 12 deletions

View File

@ -122,15 +122,13 @@ function config_includes_map_find_text_origin(array $map, string $file, string $
return $res; return $res;
} }
//TODO: function config2json(object $conf, int $json_flags = 0) : string
//function conf2json(object $conf, int $json_flags = 0) : string {
//{ $arr = $conf->export(true);
// $arr = $conf->export(true); $arr['class'] = get_class($conf);
// $arr['class'] = get_class($conf); unset($arr['id']); // @phpstan-ignore-line
// unset($arr['id']); unset($arr['strid']); // @phpstan-ignore-line
// unset($arr['strid']); $json = json_encode($arr, $json_flags);
// $json = json_encode($arr, $json_flags); $json = str_replace(array('\\\\', '\\n', '\/'), array('\\', "\n", '/'), $json);
// $json = str_replace(array('\\\\', '\\n', '\/'), array('\\', "\n", '/'), $json); return $json;
// return $json; }
//}