老师讲的真不错,不过这个缓存时间有点麻烦,可以在文件存入time()+$cacheTime, 然后跟time()比较就好了。
2018-04-17
public function __construct($code,$message,$data,$type){
$this->data = array(
'code' => $code,
'message' => $message,
'data' => $data
);
switch($type){
case "json": $this->json();break;
case "xml": $this->xml(); break;
default: echo "UNKNOW".$type;return false;break;
}}
$this->data = array(
'code' => $code,
'message' => $message,
'data' => $data
);
switch($type){
case "json": $this->json();break;
case "xml": $this->xml(); break;
default: echo "UNKNOW".$type;return false;break;
}}
2018-04-11