From f04814d2d93d51518f83b38c6466617d35d71fa9 Mon Sep 17 00:00:00 2001 From: Hannes Magnusson Date: Mon, 14 Apr 2008 08:23:27 +0000 Subject: [PATCH] Document the stream notification parameter git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@257436 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/stream/contexts.xml | 40 +--- .../stream-notification-callback.xml | 209 ++++++++++++++++++ 2 files changed, 216 insertions(+), 33 deletions(-) create mode 100644 reference/stream/functions/stream-notification-callback.xml diff --git a/reference/stream/contexts.xml b/reference/stream/contexts.xml index b0792cccf6..0170b20a85 100644 --- a/reference/stream/contexts.xml +++ b/reference/stream/contexts.xml @@ -1,7 +1,7 @@ - + - + Stream Contexts A context is a set of parameters and @@ -15,39 +15,13 @@ Options can be specified when calling stream_context_create, or later using stream_context_set_option. - - A list of wrapper specific options can be found with - the list of built-in wrappers (See ). + A list of wrapper specific options can be found in the + chapter. - In addition, parameters may be set on a context - using stream_context_set_params. Currently the only - context parameter supported by PHP is - notification. The value of this parameter must be the - name of a function to be called when an event occurs on a stream. - The notification function called during an event should accept the following - six parameters: - - - voidmy_notifier - intnotification_code - intseverity - stringmessage - intmessage_code - intbytes_transferred - intbytes_max - - - notification_code and severity - are numerical values which correspond to the STREAM_NOTIFY_* - constants listed below. - - If a descriptive message is available from the stream, message - and message_code will be populated with the appropriate values. - The meaning of these values is dependent on the specific wrapper in use. - - bytes_transferred and bytes_max will - be populated when applicable. + Parameters can be specified for + contexts using the + stream_context_set_params function. diff --git a/reference/stream/functions/stream-notification-callback.xml b/reference/stream/functions/stream-notification-callback.xml new file mode 100644 index 0000000000..7b1c4c9445 --- /dev/null +++ b/reference/stream/functions/stream-notification-callback.xml @@ -0,0 +1,209 @@ + + + + + + stream_notification_callback + A callback function for the notification context paramater + + + + &reftitle.description; + + voidstream_notification_callback + intnotification_code + intseverity + stringmessage + intmessage_code + intbytes_transferred + intbytes_max + + + A callback function called during an event. + + + + This is note a real function, only a prototype of how the function should + be. + + + + + + &reftitle.parameters; + + + + notification_code + + + One of the STREAM_NOTIFY_* notification constants. + + + + + severity + + + One of the STREAM_NOTIFY_SEVERITY_* notification constants. + + + + + message + + + Passed if a descriptive message is available for the event. + + + + + message_code + + + Passed if a descriptive message code is available for the event. + + + The meaning of this value is dependent on the specific wrapper in use. + + + + + bytes_transferred + + + If applicable, the bytes_transferred will be + populated. + + + + + bytes_max + + + If applicable, the bytes_transferred will be + populated. + + + + + + + + + + &reftitle.returnvalues; + + &return.void; + + + + + &reftitle.examples; + + + <function>stream_notification_callback</function> example + + "stream_notification_callback")); + +file_get_contents("http://php.net/contact", false, $ctx); +?> +]]> + + &example.outputs.similar; + + + + + + + + + &reftitle.seealso; + + + + + + + + + + +