Closed filips123 closed 6 years ago
Add support for reading from strings and writing to strings instead of files. This could be done with methodsfromString($format, $data) and toString($format, $data).
fromString($format, $data)
toString($format, $data)
Note that the format parameter should be case insensitive.
Example of reading:
$settings = <<<FOOBAR { "application": { "name": "configuration", "secret": "s3cr3t" }, "host": "localhost", "port": 80, "servers": [ "host1", "host2", "host3" ] } FOOBAR; $conf = Config::fromString('JSON', $json);
Example of writing:
$json = $conf->toString('JSON') $conf->toString('YAML', $yaml);
I've created pull request #111 for loading from string.
Add support for reading from strings and writing to strings instead of files. This could be done with methods
fromString($format, $data)
andtoString($format, $data)
.Note that the format parameter should be case insensitive.
Example of reading:
Example of writing: