Skip to content

Commit 4980fd9

Browse files
committed
stream_context_create() with params argument
1 parent 0f7b911 commit 4980fd9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Peachpie.Library/Streams/Streams.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public static class PhpContexts
4141

4242
/// <summary>Create a new stream context.</summary>
4343
/// <param name="options">The 2-dimensional array in format "options[wrapper][option]".</param>
44-
public static PhpResource stream_context_create(PhpArray options = null)
44+
/// <param name="params">Must be an associative array in the format $arr['parameter'] = $value, or null. Refers to context parameters.</param>
45+
public static PhpResource stream_context_create(PhpArray options = null, PhpArray @params = null)
4546
{
4647
if (options == null)
4748
{
@@ -51,7 +52,10 @@ public static PhpResource stream_context_create(PhpArray options = null)
5152
// OK, data lead to a valid stream-context.
5253
if (CheckContextData(options))
5354
{
54-
return new StreamContext(options);
55+
return new StreamContext(options)
56+
{
57+
Parameters = @params,
58+
};
5559
}
5660

5761
// Otherwise..

0 commit comments

Comments
 (0)