array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'oauthprovider.tokenhandler.php', 1 => 'OAuthProvider::tokenHandler', 2 => 'Set the tokenHandler handler callback', ), 'up' => array ( 0 => 'class.oauthprovider.php', 1 => 'OAuthProvider', ), 'prev' => array ( 0 => 'oauthprovider.timestampnoncehandler.php', 1 => 'OAuthProvider::timestampNonceHandler', ), 'next' => array ( 0 => 'class.oauthexception.php', 1 => 'OAuthException', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/oauth/oauthprovider/tokenhandler.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(PECL OAuth >= 1.0.0)
OAuthProvider::tokenHandler — Set the tokenHandler handler callback
Sets the token handler callback, which will later be called with OAuthProvider::callTokenHandler().
Наразі ця функція не документована. Доступний лише список її параметрів.
callback_function
The callable functions name.
Не повертає значень.
Приклад #1 Example OAuthProvider::tokenHandler() callback
<?php
function tokenHandler($provider) {
if ($provider->token === 'rejected') {
return OAUTH_TOKEN_REJECTED;
} elseif ($provider->token === 'revoked') {
return OAUTH_TOKEN_REVOKED;
}
$provider->token_secret = "the_tokens_secret";
return OAUTH_OK;
}
?>