getdns Functions
PHP Manual

php_getdns_context_get_update_callback

(PECL getdns >= 0.10.0)

php_getdns_context_get_update_callbackGet the name of the function that will be called when a context value changes.

Description

int php_getdns_context_get_update_callback ( int $context , array &$userArg )

This function gets the name of a callback function in PHP user space and associated user arguments that will be called when a context value changes. The callback function will be written to accept two parameters. The first is an integer value that identifies the context element that has been changed. The second is an array that represents the user arguments passed to the php_getdns_context_set_update_callback() function.

Parameters

context

The previously created DNS context that is to be used with this request.

userArg

Either NULL if no context update callback has been set or an indexed array that contains information used to control callback processing. The first element of the array will contain a character string representing the name of the PHP client function that will be called when a context value changes. Additional array elements are optional and may be present if user arguments were passed to the php_getdns_context_set_update_callback() function. The callback function will receive the complete array for local processing with all elements included as specified. Note that this argument is passed by reference and any existing value will be overwritten.

It's important to understand that the getdns library copies the address of the userArg data structure that was passed to the php_getdns_context_set_update_callback() function. Any changes to this value that are made after calling php_getdns_context_set_update_callback() may have unintended consequences. Callers should use a new PHP variable to receive the userArg array from this function to avoid overwriting any existing values that were previously set.

Return Values

This function returns an integer response code. GETDNS_RETURN_GOOD indicates successful completion.


getdns Functions
PHP Manual