深圳市一览网络股份有限
公司
ShenZhen Elanw Network
Co.,Ltd.
地址:南山科技园南区数字技术园
B2 栋 4A
Add: Room A,4th Floor,Block
B2,Digi-Tech Park ,
电话(Tel):0755-86133725
传真(Fax):0755-22632616
网址
(Web):www.YL1001.com
/**
* 把 cookie 写入缓存
* @param string $filename 缓存文件名
* @param string $content 文件内容
* @return bool
*/
public
function
saveCookie(
$filename
,
$content
){
return
file_put_contents
(
$filename
,
$content
);
}
/**
* 读取 cookie 缓存内容
* @param string $filename 缓存文件名
* @return string cookie
*/
public
function
getCookie(
$filename
){
if
(
file_exists
(
$filename
)) {
$mtime
=
filemtime
(
$filename
);
if
(
$mtime
<time()-
$this
->_cookieexpired)
return
false;
$data
=
file_get_contents
(
$filename
);
if
(
$data
)
$this
->cookie =
$data
;
}
return
$this
->cookie;
}
/*
* 删除 cookie
*/
public
function
deleteCookie(
$filename
) {
$this
->cookie = '';
@unlink(
$filename
);
return
true;
}
private
function
log(
$log
){
if
(
$this
->debug && function_exists(
$this
->_logcallback)) {
if
(
is_array
(
$log
))
$log
= print_r(
$log
,true);
return
call_user_func(
$this
->_logcallback,
$log
);
}
}
/**
* 获取登陆二维码对应的授权码
*/