Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb0d7e95

Browse files
committed
Merge remote-tracking branch 'origin/2.2' into 2.2
2 parentse99502d +afce899 commitb0d7e95

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

‎components/yaml/introduction.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,26 @@ error occurred:
120120
As the parser is re-entrant, you can use the same parser object to load
121121
different YAML strings.
122122

123-
When loading a YAML file, it is sometimes better to use the
123+
It may also be convenient to use the
124124
:method:`Symfony\\Component\\Yaml\\Yaml::parse` wrapper method:
125125

126126
..code-block::php
127127
128128
use Symfony\Component\Yaml\Yaml;
129129
130-
$yaml = Yaml::parse('/path/to/file.yml');
130+
$yaml = Yaml::parse(file_get_contents('/path/to/file.yml'));
131131
132132
The:method:`Symfony\\Component\\Yaml\\Yaml::parse` static method takes a YAML
133133
string or a file containing YAML. Internally, it calls the
134134
:method:`Symfony\\Component\\Yaml\\Parser::parse` method, but enhances the
135135
error if something goes wrong by adding the filename to the message.
136136

137+
..caution::
138+
139+
Because it is currently possible to pass a filename to this method, you
140+
must validate the input first. Passing a filename is deprecated in
141+
Symfony 2.2, and will be removed in Symfony 3.0.
142+
137143
Executing PHP Inside YAML Files
138144
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
139145

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp