ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Yaml offers convenience methods to load and dump YAML. More...
Static Public Member Functions | |
static | parse ($input, $flags=0) |
Parses YAML into a PHP value. More... | |
static | dump ($input, $inline=2, $indent=4, $flags=0) |
Dumps a PHP value to a YAML string. More... | |
Data Fields | |
const | DUMP_OBJECT = 1 |
const | PARSE_EXCEPTION_ON_INVALID_TYPE = 2 |
const | PARSE_OBJECT = 4 |
const | PARSE_OBJECT_FOR_MAP = 8 |
const | DUMP_EXCEPTION_ON_INVALID_TYPE = 16 |
const | PARSE_DATETIME = 32 |
const | DUMP_OBJECT_AS_MAP = 64 |
const | DUMP_MULTI_LINE_LITERAL_BLOCK = 128 |
|
static |
Dumps a PHP value to a YAML string.
The dump method, when supplied with an array, will do its best to convert the array into friendly YAML.
mixed | $input | The PHP value |
int | $inline | The level where you switch to inline YAML |
int | $indent | The amount of spaces to use for indentation of nested nodes |
int | $flags | A bit field of DUMP_* constants to customize the dumped YAML string |
Definition at line 94 of file Yaml.php.
References Symfony\Component\Yaml\Yaml\DUMP_EXCEPTION_ON_INVALID_TYPE, and Symfony\Component\Yaml\Yaml\DUMP_OBJECT.
Referenced by Symfony\Component\Yaml\Tests\YamlTest\testNegativeIndentationThrowsException(), Symfony\Component\Yaml\Tests\YamlTest\testParseAndDump(), and Symfony\Component\Yaml\Tests\YamlTest\testZeroIndentationThrowsException().
|
static |
Parses YAML into a PHP value.
Usage: $array = Yaml::parse(file_get_contents('config.yml')); print_r($array);
string | $input | A string containing YAML |
int | $flags | A bit field of PARSE_* constants to customize the YAML parser behavior |
ParseException | If the YAML is not valid |
Definition at line 48 of file Yaml.php.
References Symfony\Component\Yaml\Yaml\PARSE_EXCEPTION_ON_INVALID_TYPE, Symfony\Component\Yaml\Yaml\PARSE_OBJECT, and Symfony\Component\Yaml\Yaml\PARSE_OBJECT_FOR_MAP.
Referenced by Symfony\Component\Yaml\Tests\DumperTest\testDumpObjectAsMap(), and Symfony\Component\Yaml\Tests\YamlTest\testParseAndDump().
const Symfony\Component\Yaml\Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE = 16 |
Definition at line 27 of file Yaml.php.
Referenced by Symfony\Component\Yaml\Dumper\dump(), Symfony\Component\Yaml\Yaml\dump(), Symfony\Component\Yaml\Inline\dump(), and Symfony\Component\Yaml\Tests\DumperTest\testObjectSupportDisabledWithExceptions().
const Symfony\Component\Yaml\Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK = 128 |
Definition at line 30 of file Yaml.php.
Referenced by Symfony\Component\Yaml\Dumper\dump(), and Symfony\Component\Yaml\Tests\DumperTest\testDumpMultiLineStringAsScalarBlock().
const Symfony\Component\Yaml\Yaml::DUMP_OBJECT = 1 |
Definition at line 23 of file Yaml.php.
Referenced by Symfony\Component\Yaml\Dumper\dump(), Symfony\Component\Yaml\Yaml\dump(), Symfony\Component\Yaml\Inline\dump(), and Symfony\Component\Yaml\Tests\DumperTest\testObjectSupportEnabled().
const Symfony\Component\Yaml\Yaml::DUMP_OBJECT_AS_MAP = 64 |
Definition at line 29 of file Yaml.php.
Referenced by Symfony\Component\Yaml\Inline\dump(), and Symfony\Component\Yaml\Tests\DumperTest\testDumpObjectAsMap().
const Symfony\Component\Yaml\Yaml::PARSE_DATETIME = 32 |
const Symfony\Component\Yaml\Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE = 2 |
Definition at line 24 of file Yaml.php.
Referenced by Symfony\Component\Yaml\Yaml\parse(), Symfony\Component\Yaml\Parser\parse(), and Symfony\Component\Yaml\Inline\parse().
const Symfony\Component\Yaml\Yaml::PARSE_OBJECT = 4 |
Definition at line 25 of file Yaml.php.
Referenced by Symfony\Component\Yaml\Yaml\parse(), Symfony\Component\Yaml\Parser\parse(), Symfony\Component\Yaml\Inline\parse(), Symfony\Component\Yaml\Tests\ParserTest\testObjectSupportEnabled(), and Symfony\Component\Yaml\Tests\ParserTest\testObjectSupportEnabledWithDeprecatedTag().
const Symfony\Component\Yaml\Yaml::PARSE_OBJECT_FOR_MAP = 8 |
Definition at line 26 of file Yaml.php.
Referenced by Symfony\Component\Yaml\Yaml\parse(), Symfony\Component\Yaml\Parser\parse(), Symfony\Component\Yaml\Inline\parse(), Symfony\Component\Yaml\Tests\DumperTest\testDumpObjectAsMap(), Symfony\Component\Yaml\Tests\ParserTest\testObjectForMap(), and Symfony\Component\Yaml\Tests\InlineTest\testParseWithMapObjects().