本文整理汇总了PHP中SaeTClientV2::set_debug方法的典型用法代码示例。如果您正苦于以下问题:PHP SaeTClientV2::set_debug方法的具体用法?PHP SaeTClientV2::set_debug怎么用?PHP SaeTClientV2::set_debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SaeTClientV2
的用法示例。
在下文中一共展示了SaeTClientV2::set_debug方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function get_info()
{
if ($this->dx_auth->is_logged_in()) {
echo "你已经登陆了";
} else {
$this->load->model('m_open');
session_start();
require_once APPPATH . 'libraries/weibo/config.php';
require_once APPPATH . 'libraries/weibo/saetv2.ex.class.php';
$o = new SaeTOAuthV2(WB_AKEY, WB_SKEY);
$o->set_debug(DEBUG_MODE);
if (isset($_REQUEST['code'])) {
$keys = array();
// 验证state
$state = $_REQUEST['state'];
if (empty($state) || $state !== $_SESSION['weibo_state']) {
echo '非法请求!';
exit;
}
unset($_SESSION['weibo_state']);
$keys['code'] = $_REQUEST['code'];
$keys['redirect_uri'] = WB_CALLBACK_URL;
try {
$token = $o->getAccessToken('code', $keys);
} catch (OAuthException $e) {
}
}
if ($token) {
$_SESSION['token'] = $token;
setcookie('weibojs_' . $o->client_id, http_build_query($token));
//echo "success";
$c = new SaeTClientV2(WB_AKEY, WB_SKEY, $_SESSION['token']['access_token']);
$c->set_debug(DEBUG_MODE);
$uid_get = $c->get_uid();
$uid = $uid_get['uid'];
if (!$uid) {
echo "error";
}
$user = $c->show_user_by_id($uid);
//根据ID获取用户等基本信息
//echo $user['screen_name'];
if ($this->m_open->is_id($uid)) {
$this->m_open->login($uid);
//echo "登陆";
//echo $uid;
//$c->update( "坑爹的api终于调好了");
redirect('line');
} else {
$this->m_open->register($user);
$this->m_open->create($user);
//echo $uid;
//echo "注册";
redirect('line');
}
} else {
echo "fail";
}
}
}
示例2: open
function open()
{
session_start();
require_once APPPATH . 'libraries/weibo/config.php';
require_once APPPATH . 'libraries/weibo/saetv2.ex.class.php';
$o = new SaeTOAuthV2(WB_AKEY, WB_SKEY);
$o->set_debug(DEBUG_MODE);
if (isset($_REQUEST['code'])) {
$keys = array();
// 验证state
$state = $_REQUEST['state'];
if (empty($state) || $state !== $_SESSION['weibo_state']) {
echo '非法请求!';
exit;
}
unset($_SESSION['weibo_state']);
$keys['code'] = $_REQUEST['code'];
$keys['redirect_uri'] = WB_CALLBACK_URL;
try {
$token = $o->getAccessToken('code', $keys);
} catch (OAuthException $e) {
}
}
if ($token) {
$_SESSION['token'] = $token;
setcookie('weibojs_' . $o->client_id, http_build_query($token));
echo "success";
$c = new SaeTClientV2(WB_AKEY, WB_SKEY, $_SESSION['token']['access_token']);
$c->set_debug(DEBUG_MODE);
$uid_get = $c->get_uid();
$uid = $uid_get['uid'];
$user = $c->show_user_by_id($uid);
//根据ID获取用户等基本信息
echo $user['screen_name'];
//利用一个方法将weibo_id存入users
//利用一个方法将weibo个人信息存入info中
} else {
echo "fail";
}
}
示例3:
<?php
session_start();
include_once 'config.php';
include_once 'saetv2.ex.class.php';
$c = new SaeTClientV2(WB_AKEY, WB_SKEY, $_SESSION['token']['access_token']);
$c->set_debug(DEBUG_MODE);
$ms = $c->home_timeline();
// done
//var_dump($ms);
$uid_get = $c->get_uid();
$uid = $uid_get['uid'];
$user_message = $c->show_user_by_id($uid);
//根据ID获取用户等基本信息
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>新浪微博V2接口演示程序-Powered by Sina App Engine</title>
</head>
<body>
<?php
echo $user_message['screen_name'];
?>
,您好!
<h2 align="left">发送新微博</h2>
<form action="" >
<input type="text" name="text" style="width:300px" />
<input type="submit" />