(PECL OAuth >= 1.0.0)
OAuthProvider::consumerHandler — 设置 consumerHandler 处理程序回调
callback_function
callable 函数的名称。
不返回值。
示例 #1 示例 OAuthProvider::consumerHandler() 回调
<?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;
}
?>