Skip to content

Commit

Permalink
stream_context_create() with params argument
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubmisek committed Aug 16, 2024
1 parent 0f7b911 commit 4980fd9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Peachpie.Library/Streams/Streams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public static class PhpContexts

/// <summary>Create a new stream context.</summary>
/// <param name="options">The 2-dimensional array in format "options[wrapper][option]".</param>
public static PhpResource stream_context_create(PhpArray options = null)
/// <param name="params">Must be an associative array in the format $arr['parameter'] = $value, or null. Refers to context parameters.</param>
public static PhpResource stream_context_create(PhpArray options = null, PhpArray @params = null)
{
if (options == null)
{
Expand All @@ -51,7 +52,10 @@ public static PhpResource stream_context_create(PhpArray options = null)
// OK, data lead to a valid stream-context.
if (CheckContextData(options))
{
return new StreamContext(options);
return new StreamContext(options)
{
Parameters = @params,
};
}

// Otherwise..
Expand Down

0 comments on commit 4980fd9

Please sign in to comment.