略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: OAuthProvider::tokenHandler

2024-05-03

OAuthProvider::tokenHandler

(PECL OAuth >= 1.0.0)

OAuthProvider::tokenHandler设置 tokenHandler 句柄回调函数

说明

public OAuthProvider::tokenHandler(callable $callback_function): void

设置令牌句柄的回调函数,此回调函数将在后面被 OAuthProvider::callTokenHandler() 调用。

警告

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

参数

callback_function

回调类型 的函数名。

返回值

没有返回值。

范例

示例 #1 OAuthProvider::tokenHandler() 回调的例子

<?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;
}
?>

参见

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/oauthprovider.tokenhandler.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3