OAuthProvider
PHP Manual

OAuthProvider::consumerHandler

(PECL OAuth >= 1.0.0)

OAuthProvider::consumerHandlerSet the consumerHandler handler callback

说明

public void OAuthProvider::consumerHandler ( callback $callback_function )

Sets the consumer handler callback, which will later be called with OAuthProvider::callConsumerHandler().

Warning

本函数还未编写文档,仅有参数列表。

参数

callback_function

The callback functions name.

返回值

没有返回值。

范例

Example #1 Example OAuthProvider::consumerHandler() callback

<?php
function lookupConsumer($provider) {

    if (
$provider->consumer_key === 'unknown') {
        return 
OAUTH_CONSUMER_KEY_UNKNOWN;
    } else if(
$provider->consumer_key == 'blacklisted' || $provider->consumer_key === 'throttled') {
        return 
OAUTH_CONSUMER_KEY_REFUSED;
    }

    
$provider->consumer_secret "the_consumers_secret";

    return 
OAUTH_OK;
}
?>

参见


OAuthProvider
PHP Manual