本文整理汇总了PHP中Encryption::unserializeFromFile方法的典型用法代码示例。如果您正苦于以下问题:PHP Encryption::unserializeFromFile方法的具体用法?PHP Encryption::unserializeFromFile怎么用?PHP Encryption::unserializeFromFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Encryption
的用法示例。
在下文中一共展示了Encryption::unserializeFromFile方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
private function __construct()
{
$this->m_target_file = tmpDir('targets.targets');
if (!file_exists($this->m_target_file)) {
$this->m_target_set = array();
return;
}
$this->m_target_set = Encryption::unserializeFromFile($this->m_target_file);
}
示例2: initOAuth
public function initOAuth()
{
$this->m_token = Encryption::unserializeFromFile(tmpDir('sina.oauth'));
if ($this->m_token['auth_timestamp'] + $this->m_token['expires_in'] < time() - 10) {
$this->reflashToken();
$this->m_token = Encryption::unserializeFromFile(tmpDir('sina.oauth'));
}
if ($this->m_token['auth_timestamp'] + $this->m_token['expires_in'] >= time()) {
$this->m_oauth = new SaeTClientV2($this->m_cfg['key'], $this->m_cfg['secret'], $this->m_token['access_token']);
}
}
示例3: __construct
public function __construct($cfg)
{
$this->m_cfg = $cfg;
$this->m_filters = array(array($this, 'ftForceSync'), array($this, 'ftForceNSync'), array($this, 'ftLevel'));
$this->m_after_filters = array();
$this->m_info_file = tmpDir($this->m_source_type . '.info');
$this->m_token_file = tmpDir($this->m_source_type . '.oauth');
if (!file_exists($this->m_token_file)) {
throw new TOException(_er('E_SOURCE_FILE_NOT_EXISTS', $this->m_info_file, $this->m_token_file));
return;
}
if (file_exists($this->m_info_file)) {
//$this->m_info = Encryption::unserializeFromFile ( $this->m_info_file );
$this->m_info = unserialize(file_get_contents($this->m_info_file));
}
$this->m_token = Encryption::unserializeFromFile($this->m_token_file);
}
示例4: display
<?php
/**
* *********************************************************
*
* @author cluries
* @link http://cdbit.com
* @version 1.0
* @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) {