CakeFest 2024: The Official CakePHP Conference

ストリームコンテキスト

コンテキスト は、ストリームの挙動を変えたり、 拡張したりすることのできる パラメータ と ラッパー固有の オプション の集合です。 コンテキスト は、 stream_context_create() を使って生成しますが、 これは、ほとんどのファイルシステム関連のストリーム生成関数に 渡すことができます (例えば fopen(), file(), file_get_contents() など)。

オプション は、 stream_context_create() の呼び出し時に指定しますが、 後で stream_context_set_option() を使って 指定することもできます。 ラッパー固有の オプション については、 コンテキストオプションとパラメータ を参照ください。

さらに、stream_context_set_params() を使うことで、 パラメータ を、コンテキスト に対し指定することができます。

add a note

User Contributed Notes 1 note

up
2
alvaro at demogracia dot com
8 years ago
Two important terms:

- An *option* is a protocol-specific setting, e.g. "method" (get, post, put...) if you are using HTTP or "callback function to be called when inserting a document" in MongoDB.

- A *parameter* is a settings that's common to all protocols. As of 2015 only one parameter got implemented ("notification").

While these words might look vague they are used coherently throughout the stream feature, documentation included.
To Top