当前位置: 首页>>代码示例>>PHP>>正文


PHP Encryption::serializeToFile方法代码示例

本文整理汇总了PHP中Encryption::serializeToFile方法的典型用法代码示例。如果您正苦于以下问题:PHP Encryption::serializeToFile方法的具体用法?PHP Encryption::serializeToFile怎么用?PHP Encryption::serializeToFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Encryption的用法示例。


在下文中一共展示了Encryption::serializeToFile方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: post

 public function post($tweet)
 {
     $response = httpRequest(self::POST_URL, $this->generatePostParams($tweet));
     $token = $this->m_oauth->getRefreshToken($this->m_token['refresh_token']);
     if (!empty($token['access_token']) && !empty($token['refresh_token'])) {
         Encryption::serializeToFile($token, tmpDir('renren.oauth'));
     }
 }
开发者ID:snowleopardw,项目名称:Tw2other,代码行数:8,代码来源:Sync.php

示例2: display

 * @copyright 2012 http://cdbit.com All rights reserved
 * 
 * *********************************************************
 */
if (islocked('sina')) {
    $takedToken = Encryption::unserializeFromFile(tmpDir('sina.oauth'));
    if (!($takedToken['auth_timestamp'] + $takedToken['expires_in'] < time() - 10)) {
        display(_er('E_LOCKED', 'sina', 'sina'), 0);
    }
}
import('/library/saetv2.ex.class.php');
global $cfg_sina;
$o = new SaeTOAuthV2($cfg_sina['key'], $cfg_sina['secret']);
if (!isset($_REQUEST['code'])) {
    display('sina认证失败');
}
$keys = array();
$keys['code'] = $_REQUEST['code'];
$keys['redirect_uri'] = callbackUrl('sina');
$token = false;
try {
    $token = $o->getAccessToken('code', $keys);
} catch (OAuthException $e) {
    display('sina认证失败:' . $e->getMessage());
}
if ($token) {
    $token['auth_timestamp'] = time();
    Encryption::serializeToFile($token, tmpDir('sina.oauth'));
    lockit('sina');
    display('sina认证成功');
}
开发者ID:snowleopardw,项目名称:Tw2other,代码行数:31,代码来源:sinaCallbackAction.php

示例3: display

 * @author cluries
 * @link http://cdbit.com
 * @version 1.0
 * @copyright 2012 http://cdbit.com All rights reserved
 * 
 * *********************************************************
 */
if (islocked('douban')) {
    display(_er('E_LOCKED', 'douban', 'douban'), 0);
}
if (empty($_REQUEST['oauth_token'])) {
    display(_er('E_404'), 0);
}
if ($_SESSION['douban_token'] != $_REQUEST['oauth_token']) {
    retry();
}
import('/library/OAuth.php');
import('/library/doubanoauth.php');
global $cfg_douban;
$o = new DoubanOAuth($cfg_douban['key'], $cfg_douban['secret'], $_SESSION['douban_token'], $_SESSION['douban_token_secret']);
$token = $o->getAccessToken();
if (!empty($token['oauth_token_secret']) && !empty($token['oauth_token'])) {
    Encryption::serializeToFile($token, tmpDir('douban.oauth'));
    lockit('douban');
    display('douban认证成功');
}
display('douban认证失败');
function retry()
{
    Header("Location:install.php?action=auth");
}
开发者ID:snowleopardw,项目名称:Tw2other,代码行数:31,代码来源:doubanCallbackAction.php

示例4: import

 * @copyright 2012 http://cdbit.com All rights reserved
 * 
 * *********************************************************
 */
import('/library/OAuth.php');
import('/library/twitteroauth.php');
if (islocked('twitter')) {
    display(_er('E_LOCKED', 'twitter', 'twitter'), 0);
}
if (isset($_REQUEST['oauth_token']) && $_SESSION['oauth_token'] != $_REQUEST['oauth_token']) {
    retry();
}
global $cfg_source;
$connection = new TwitterOAuth($cfg_source['key'], $cfg_source['secret'], $_SESSION['oauth_token'], $_SESSION['oauth_token_secret']);
$access_token = $connection->getAccessToken($_REQUEST['oauth_verifier']);
$_SESSION['access_token'] = $access_token;
unset($_SESSION['oauth_token']);
unset($_SESSION['oauth_token_secret']);
if (200 == $connection->http_code) {
    $_SESSION['status'] = 'verified';
    //updateOauth ( $access_token );
    Encryption::serializeToFile($access_token, tmpDir('twitter.oauth'));
    lockit('twitter');
    display('Twiter认证成功');
} else {
    retry();
}
function retry()
{
    Header("Location:install.php?action=auth");
}
开发者ID:snowleopardw,项目名称:Tw2other,代码行数:31,代码来源:twitterCallbackAction.php

示例5: display

/**
 * *********************************************************
 * 
 * @author cluries
 * @link http://cdbit.com
 * @version 1.0
 * @copyright 2012 http://cdbit.com All rights reserved
 * 
 * *********************************************************
 */
if (islocked('renren')) {
    display(_er('E_LOCKED', 'renren', 'renren'), 0);
}
if (empty($_REQUEST['code'])) {
    display(_er('E_404'), 0);
}
global $cfg_renren;
import('/library/renrenoauth.php');
$keys = array();
$keys['code'] = $_REQUEST['code'];
$keys['redirect_uri'] = callbackUrl('renren');
try {
    $o = new RenrenOAuth($cfg_renren['key'], $cfg_renren['secret']);
    $token = $o->getAccessToken($_REQUEST['code'], callbackUrl('renren'));
    Encryption::serializeToFile($token, tmpDir('renren.oauth'));
    lockit('renren');
    display('renren认证成功');
} catch (OAuthException $e) {
    display('renren认证失败', 0);
}
开发者ID:snowleopardw,项目名称:Tw2other,代码行数:30,代码来源:renrenCallbackAction.php

示例6: display

<?php

/**
 * *********************************************************
 * 
 * @author cluries
 * @link http://cdbit.com
 * @version 1.0
 * @copyright 2012 http://cdbit.com All rights reserved
 * 
 * *********************************************************
 */
if (islocked('tencent')) {
    display(_er('E_LOCKED', 'tencent', 'tencent'), 0);
}
empty($_SESSION['tencent_keys']) && display('SESSION中没找到对应的KEY', 0);
import('/library/OAuth.php');
import('/library/tencentoauth.php');
global $cfg_tencent;
$o = new MBOpenTOAuth($cfg_tencent['key'], $cfg_tencent['secret'], $_SESSION['tencent_keys']['oauth_token'], $_SESSION['tencent_keys']['oauth_token_secret']);
unset($_SESSION['tencent_keys']);
$last_key = $o->getAccessToken($_REQUEST['oauth_verifier']);
if (!empty($last_key['oauth_token']) && !empty($last_key['oauth_token_secret'])) {
    Encryption::serializeToFile($last_key, tmpDir('tencent.oauth'));
    lockit('tencent');
    display('Tencent认证成功');
} else {
    display('Tencent认证失败', 0);
}
开发者ID:snowleopardw,项目名称:Tw2other,代码行数:29,代码来源:tencentCallbackAction.php

示例7: __destruct

 public function __destruct()
 {
     Encryption::serializeToFile($this->m_target_set, $this->m_target_file);
 }
开发者ID:snowleopardw,项目名称:Tw2other,代码行数:4,代码来源:TargetSet.php


注:本文中的Encryption::serializeToFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。