3 declare(strict_types=1);
    40     public function __construct(JsonParser $json_parser, 
string $base_dir = null)
    43         $this->base_dir = $base_dir ?? getcwd();
    58         if (!is_readable($name)) {
    59             throw new \InvalidArgumentException(
    60                 "Config-file '$name' does not exist or is not readable."    63         $json = $this->json_parser->parse(
    64             file_get_contents($name),
    65             JsonParser::PARSE_TO_ASSOC | JsonParser::DETECT_KEY_CONFLICTS
    68         if (!is_array($json)) {
    69             throw new \InvalidArgumentException(
    70                 "Could not find JSON-array in '$name'."    79         $replacer = 
function ($subject, 
$path, $value) use (&$replacer) {
    80             if (count($path) === 0) {
    83             $cur = array_shift($path);
    84             $subject[$cur] = $replacer($subject[$cur] ?? [], $path, $value);
    88         foreach ($overwrites as $path => $value) {
    89             $path = explode(
".", (
string) $path);
    90             $json = $replacer($json, $path, $value);
    98         if (in_array($name[0], [
"/", 
"\\"])) {
   101         return $this->base_dir . 
"/" . $name;
 __construct(JsonParser $json_parser, string $base_dir=null)
 
Read a json-formatted config from a file and overwrite some fields. 
 
readConfigFile(string $name, array $overwrites=[])
TODO: We could use the "give me a transformation and I'll give you your       result" pattern from th...
 
applyOverwrites(array $json, array $overwrites)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
getRealFilename(string $name)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...