Adding config2json
Publish PHP Package / docker (push) Successful in 7s
Details
Publish PHP Package / docker (push) Successful in 7s
Details
This commit is contained in:
parent
a15f4f935e
commit
458b72e367
22
util.inc.php
22
util.inc.php
|
@ -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;
|
}
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue