You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.3 KiB
58 lines
1.3 KiB
<?php
|
|
namespace kuange\qqconnect;
|
|
/* PHP SDK
|
|
* @version 2.0.0
|
|
* @author connect@qq.com
|
|
* @copyright © 2013, Tencent Corporation. All rights reserved.
|
|
*/
|
|
|
|
class Recorder{
|
|
private static $data;
|
|
private $inc;
|
|
private $error;
|
|
|
|
public function __construct(){
|
|
$this->error = new ErrorCase();
|
|
|
|
//-------读取配置文件
|
|
$config = db('plugin')->where('code','=','qq')->find();
|
|
$this->inc = unserialize($config['config_value']);
|
|
if(empty($this->inc)){
|
|
$this->error->showError("20001");
|
|
}
|
|
|
|
if(empty(session('QC_userData'))){
|
|
self::$data = array();
|
|
}else{
|
|
self::$data = session('QC_userData');
|
|
}
|
|
}
|
|
|
|
public function write($name,$value){
|
|
self::$data[$name] = $value;
|
|
}
|
|
|
|
public function read($name){
|
|
if(empty(self::$data[$name])){
|
|
return null;
|
|
}else{
|
|
return self::$data[$name];
|
|
}
|
|
}
|
|
|
|
public function readInc($name){
|
|
if(empty($this->inc[$name])){
|
|
return null;
|
|
}else{
|
|
return $this->inc[$name];
|
|
}
|
|
}
|
|
|
|
public function delete($name){
|
|
unset(self::$data[$name]);
|
|
}
|
|
|
|
function __destruct(){
|
|
session('QC_userData', self::$data);
|
|
}
|
|
}
|
|
|