我们使用phpmailer登录邮件发邮件也是使用了curl原理来实现模仿用户发邮件了,今天看了两个利用CURL函数登入163邮箱并获取自己的通讯录的例子,希望对各位有帮助。
学习了一些CURL的基础知识并做了这个示例,关于CURL的知识可以从php的官网上查看,点击查看。
示例代码调试方式:把$userName和$password换成自己163邮箱的用户名和密码即可。
注意:用户名和密码一定要正确,否则报错,没有做容错处理。
示例代码如下:
代码如下 |
复制代码 |
<?php
//==================账号信息==================
//用户名
$userName = 'xxxxxxxx';
//密码
$password = 'xxxxxxxx';
//邮箱
$email = $userName . '@163.com';
//==================登录==================
//登录地址(登录地址并不是form表单设置的地址,通过js修改了form的action属性,需要查看登录页面源码才能发现)
$loginUrl = "https://ssl.mail.163.com/entry/coremail/fcg/ntesdoor2?df=mail163_letter&from=web&funcid=loginone&iframe=1&language=-1&passtype=1&product=mail163&net=n&style=-1&race=-2_56_-2_hz&uid={$email}";
//登录时发送的post数据(查看form表单,注意有隐藏域)
$postArray = array(
"url2" => "http://mail.163.com/errorpage/error163.htm",
"savelogin" => 0, "username" => trim($userName), "password" => $password,
);
$postString = '';
foreach($postArray as $key => $value){
$postString .= "{$key}={$value}&";
}
$postString = trim($postString, '&');
//初始化CURL对象
$curl = curl_init();
//设置请求地址
curl_setopt($curl, CURLOPT_URL, $loginUrl);
//禁用后CURL将终止从服务端进行验证
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
//启用时将获取的信息以文件流的形式返回,而不是直接输出
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
//启用时会将头文件的信息作为数据流输出
curl_setopt($curl, CURLOPT_HEADER, TRUE);
//设置POST参数
curl_setopt($curl, CURLOPT_POST, TRUE);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postString);
//执行给定的CURL会话
//成功时返回 TRUE,失败时返回 FALSE
//然而,如果 CURLOPT_RETURNTRANSFER选项被设置,函数执行成功时会返回执行的结果,失败时返回 FALSE
$html = curl_exec($curl);
//把获取到的数据写入文件中以便查看
//file_put_contents('temp1.txt', $html);
//分割头文件和内容
list($head, $content) = explode("\r\n\r\n", $html, 2);
//把获取到的数据写入文件中以便查看
//file_put_contents('temp2.txt', $head);
//file_put_contents('temp3.txt', $content);
$head = explode("\r\n", $head);
//获取cookie信息
$cookieString = '';
foreach ($head as $value){
if(stripos($value, "Set-Cookie: ") !== false){
$cookieString .= str_replace("Set-Cookie: ", "", $value);
}
}
//从content里分析出sid值(读取通讯录信息的参数)
$startString = 'top.location.href = "';
$endString = '";</script>';
$start = strpos($content, $startString);
$end = strpos($content, $endString);
$tempUrl = substr($content, $start + strlen($startString), $end - $start - strlen($startString));
$tempUrlVals = parse_url($tempUrl);
parse_str($tempUrlVals['query'], $queryVals);
$sid = $queryVals['sid'];
//==================读取邮箱==================
//读取邮箱地址
$readUrl = "http://twebmail.mail.163.com/contacts/call.do?uid={$email}&sid={$sid}&from=webmail&cmd=newapi.getContacts&vcardver=3.0&ctype=all&attachinfos=yellowpage";
//设置请求地址
curl_setopt($curl, CURLOPT_URL, $readUrl);
//设置POST参数
curl_setopt($curl, CURLOPT_POST, TRUE);
curl_setopt($curl, CURLOPT_POSTFIELDS, 'order=[{"field":"N","desc":"false"}]');
//注意这里要设置从登录操作中获取的cookie
curl_setopt($curl, CURLOPT_COOKIE, $cookieString);
//禁用头文件输出
curl_setopt($curl, CURLOPT_HEADER, FALSE);
//执行给定的CURL会话
//成功时返回 TRUE,失败时返回 FALSE
//然而,如果 CURLOPT_RETURNTRANSFER选项被设置,函数执行成功时会返回执行的结果,失败时返回 FALSE
$content = curl_exec($curl);
//把获取到的数据写入文件中以便查看
//file_put_contents('temp4.txt', $content);
//关闭一个CURL会话,并释放资源
curl_close($curl);
echo '<pre>';
print_r(json_decode($content, true));
echo '</pre>';
|
例子二,这个更高级一些可以输入信息
代码如下 |
复制代码 |
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<title>登陆163邮箱</title>
</head>
<body>
<form id="login" action="mail.php" method="POST">
<label for="username">用户名:</label><input id="username" name="username" type="text" />
<label for="password">密码:</label><input id="password" name="password" type="password" />
<input type="submit" value="取得通讯录列表" />
</form>
</body>
</html>
|
mail.php
代码如下 |
复制代码 |
<?php
define("COOKIEJAR",ini_get( "upload_tmp_dir" ).DIRECTORY_SEPARATOR."cookie.txt");
if( !isset($_POST['username']) || !isset($_POST['username']) ){
echo 'ERROR QUEST';
exit();
}
$username = $_POST['username'];
$pos = strrpos($username,'@');
if($pos === false){
$username .= "@163.com";
}
$password = $_POST['password'];
//登陆163邮箱,获得登陆后的cookie
$options = array(
CURLOPT_URL => "https://reg.163.com/logins.jsp",
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => "username=".$username."&password=".$password,
CURLOPT_COOKIEJAR => COOKIEJAR,
);
curl_quest($options);
//利用上一步获得的cookie进一步取得cookie
$options2 = array(
CURLOPT_URL => "http://fm163.163.com/coremail/fcg/ntesdoor2?verifycookie=1&lightweight=1",
CURLOPT_COOKIEFILE => COOKIEJAR,
CURLOPT_COOKIEJAR => COOKIEJAR,
);
curl_quest($options2);
//分析cookie文件,取得coremail.
$cookiefile = file_get_contents(COOKIEJAR);
preg_match('|Coremail.*?%(\S*)|',$cookiefile,$sid);
//发送获得通讯录xml请求.
$postStr3 = '<?xml version="1.0"?><object><array name="items"><object><string name="func">pab:searchContacts</string
><object name="var"><array name="order"><object><string name="field">FN</string><boolean name="ignoreCase"
>true</boolean></object></array></object></object><object><string name="func">user:getSignatures</string
></object><object><string name="func">pab:getAllGroups</string></object></array></object>';
$options3 = array(
CURLOPT_URL => 'http://eg1a120.mail.163.com/a/s?sid='.$sid[1].'&func=global:sequential',
CURLOPT_HTTPHEADER => array('Content-Type: application/xml'),
CURLOPT_POST => 1,
CURLOPT_COOKIEFILE => COOKIEJAR,
CURLOPT_POSTFIELDS => $postStr3,
CURLOPT_REFERER => 'http://eg1a120.mail.163.com/a/f/js3/0811050934/index_v12.htm',
);
$mailsxml = curl_quest($options3,true);
//输出获得的通讯录xml
header("Content-Type: application/xml");
echo $mailsxml;
function curl_quest($ops,$return = false){
$ch = curl_init();
curl_setopt_array($ch,$ops);
ob_start( );
curl_exec($ch);
if($return){
$content=ob_get_contents();
}
curl_close($ch);
ob_end_clean();
if($return){
return $content;
}
}
?>
|
php多进程这个东西先是在java中有不过现在高版本的php也支持多进程这个功能,但经过测试性能不如java了希望后期有所提高了,下面我们一起来看看我整理了几个关于php多进程例子,希望能帮助你理解多线程了哦。
php多进程的实现依赖于pcntl扩展,编译PHP的时候,可以加上’–enable-pcntl’或者也可以单独编译。
有三点需要注意:
1.子进程不在执行fork之前的代码,只是把父进程的内存状况复制一份新的,所以,关于子进程的个性化设置需要单独设置。
2.输出重定向,程序中使用echo,或造成命令行的混乱,影响分辨。可以用ob_start重定向到log文件,当然,你直接使用log是更好的办法。此实例中log文件,按照进程pid分组。
3.父进程没有代码执行,将可能提前退出,子进程可能成为孤儿进程。
demo接受:
用10个子进程来处理输出任务,任务总量是1000,然后,按照任务数平均分到十个子进程当中去。
代码如下 |
复制代码 |
<?php
//输出重定向到log文件
function echo_to_log($content){
global $current_pid;
$logfile = __FILE__ . $current_pid . '.log';
$fp = fopen($logfile, 'a+');
fwrite($fp, $content);
fclose($fp);
}
ob_start('echo_to_log');
//获取当前进程pid
$current_pid = getmypid();
$fork_nums = 10;
$total = 1000;
for($i = 0; $i < $fork_nums; $i++){
$pid = pcntl_fork();
//等于0时,是子进程
if($pid == 0){
$current_pid = $pid;
do_task($i);
//大于0时,是父进程,并且pid是产生的子进程的PID
} else if($pid > 0) {
}
}
//任务函数
function do_task($task_num){
global $total;
$start = $total / 10 * $task_num;
$end = $total / 10 * ($task_num + 1);
for(;$start<$end;$start++){
echo $task_num . " " . $start . "\n";
}
//子进程执行完任务以后终止,当然你可以返回主进程的代码部分做相关操作。
exit();
}
|
多进程控制的框架代码,留着备查
代码如下 |
复制代码 |
declare(ticks=1);
function sigHandler($signal)
{
echo "a child exited\n";
}
pcntl_signal(SIGCHLD, sigHandler, false);
echo "this is " . posix_getpid() . PHP_EOL;
for($i=0; $i<3; $i++)
{
$pid = pcntl_fork();
if($pid == -1)
{
echo 'fork failed ' . PHP_EOL;
}
else if($pid)
{
}
else
{
$pid = posix_getpid();
echo 'child ' . $pid . ' ' . time() . PHP_EOL;
sleep(rand(2,5));
echo 'child ' . $pid . ' done ' . time() . PHP_EOL;
exit(0);
}
}
do
{
$pid = pcntl_wait($status);
echo 'child quit ' . $pid . PHP_EOL;
}while($pid > 0);
echo 'parent done' . PHP_EOL;
|
例子
给出一段PHP多线程、与For循环,抓取百度搜索页面的PHP代码示例:
代码如下 |
复制代码 |
<?php
class test_thread_run extends Thread
{
public $url;
public $data;
public function __construct($url)
{
$this->url = $url;
}
public function run()
{
if(($url = $this->url))
{
$this->data = model_http_curl_get($url);
}
}
}
function model_thread_result_get($urls_array)
{
foreach ($urls_array as $key => $value)
{
$thread_array[$key] = new test_thread_run($value["url"]);
$thread_array[$key]->start();
}
foreach ($thread_array as $thread_array_key => $thread_array_value)
{
while($thread_array[$thread_array_key]->isRunning())
{
usleep(10);
}
if($thread_array[$thread_array_key]->join())
{
$variable_data[$thread_array_key] = $thread_array[$thread_array_key]->data;
}
}
return $variable_data;
}
function model_http_curl_get($url,$userAgent="")
{
$userAgent = $userAgent ? $userAgent : 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2)';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_TIMEOUT, 5);
curl_setopt($curl, CURLOPT_USERAGENT, $userAgent);
$result = curl_exec($curl);
curl_close($curl);
return $result;
}
for ($i=0; $i < 100; $i++)
{
$urls_array[] = array("name" => "baidu", "url" => "http://www.baidu.com/s?wd=".mt_rand(10000,20000));
}
$t = microtime(true);
$result = model_thread_result_get($urls_array);
$e = microtime(true);
echo "多线程:".($e-$t)."\n";
$t = microtime(true);
foreach ($urls_array as $key => $value)
{
$result_new[$key] = model_http_curl_get($value["url"]);
}
$e = microtime(true);
echo "For循环:".($e-$t)."\n";
?>
|
PHP多线程类)
代码如下 |
复制代码 |
/**
* @title: PHP多线程类(Thread)
* @version: 1.0
* @author: < web@ >
* @published: 2010-11-2
*
* PHP多线程应用示例:
* require_once 'thread.class.php';
* $thread = new thread();
* $thread->addthread('action_log','a');
* $thread->addthread('action_log','b');
* $thread->addthread('action_log','c');
* $thread->runthread();
*
* function action_log($info) {
* $log = 'log/' . microtime() . '.log';
* $txt = $info . "rnrn" . 'Set in ' . Date('h:i:s', time()) . (double)microtime() . "rn";
* $fp = fopen($log, 'w');
* fwrite($fp, $txt);
* fclose($fp);
* }
*/
class thread {
var $hooks = array();
var $args = array();
function thread() {
}
function addthread($func)
{
$args = array_slice(func_get_args(), 1);
$this->hooks[] = $func;
$this->args[] = $args;
return true;
}
function runthread()
{
if(isset($_GET['flag']))
{
$flag = intval($_GET['flag']);
}
if($flag || $flag === 0)
{
call_user_func_array($this->hooks[$flag], $this->args[$flag]);
}
else
{
for($i = 0, $size = count($this->hooks); $i < $size; $i++)
{
$fp=fsockopen($_SERVER['HTTP_HOST'],$_SERVER['SERVER_PORT']);
if($fp)
{
$out = "GET {$_SERVER['PHP_SELF']}?flag=$i HTTP/1.1rn";
$out .= "Host: {$_SERVER['HTTP_HOST']}rn";
$out .= "Connection: Closernrn";
fputs($fp,$out);
fclose($fp);
}
}
}
}
}
|
使用方法:
代码如下 |
复制代码 |
$thread = new thread();
$thread->addthread('func1','info1');
$thread->addthread('func2','info2');
$thread->addthread('func3','info3');
$thread->runthread();
|
说明:
addthread是添加线程函数,第一个参数是函数名,之后的参数(可选)为传递给指定函数的参数。
runthread是执行线程的函数。
在linux系统中需要配置安装一下pthreads
1、扩展的编译安装(Linux),www.111cn.net 编辑参数 --enable-maintainer-zts 是必选项:
代码如下 |
复制代码 |
cd /Data/tgz/php-5.5.1
./configure --prefix=/Data/apps/php --with-config-file-path=/Data/apps/php/etc --with-mysql=/Data/apps/mysql --with-mysqli=/Data/apps/mysql/bin/mysql_config --with-iconv-dir --with-freetype-dir=/Data/apps/libs --with-jpeg-dir=/Data/apps/libs --with-png-dir=/Data/apps/libs --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-fpm --enable-mbstring --with-mcrypt=/Data/apps/libs --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-opcache --with-pdo-mysql --enable-maintainer-zts
make clean
make
make install
unzip pthreads-master.zip
cd pthreads-master
/Data/apps/php/bin/phpize
./configure --with-php-config=/Data/apps/php/bin/php-config
make
make install
vi /Data/apps/php/etc/php.ini
|
添加:
代码如下 |
复制代码 |
extension = "pthreads.so" |
PHP扩展下载:https://github.com/krakjoe/pthreads
PHP手册文档:http://php.net/manual/zh/book.pthreads.php
最近某个PHP项目用到了限制登录时间的功能,比如用户登录系统60分钟后如果没有操作就自动退出,我搜索了网络收集了有以下方法可供参考。
第一种方法即设置php.ini配置文件,设置session.gc_maxlifetime和session.cookie_lifetime节点属性值,当然也可以使用ini_set函数改变当前上下文环境的属性值:
代码如下 |
复制代码 |
ini_set('session.gc_maxlifetime', "3600"); // 秒
ini_set("session.cookie_lifetime","3600"); // 秒
|
第二种方法即设置Session时间戳,比如下面的办法。
在登录成功时设置时间戳为当前时间推后1小时,$_SESSION['expiretime'] = time() + 3600;。在检查用户登录情况使用如下代码:
代码如下 |
复制代码 |
if(isset($_SESSION['expiretime'])) {
if($_SESSION['expiretime'] < time()) {
unset($_SESSION['expiretime']);
header('Location: logout.php?TIMEOUT'); // 登出
exit(0);
} else {
$_SESSION['expiretime'] = time() + 3600; // 刷新时间戳
}
}
|
经验,其实session超时时间php默认就有一会时间了,当然我们可以按上面的方法来设置一下了,这种做法我觉得使用cookies会更方便哦。
php中数据排序可以用sort但如果要做到数组分组排序的话我们可以使用array_multisort函数或者使用多重复遍历来做,下面看一个例子。
PHP的数组,数组中的内容大致如下:
代码如下 |
复制代码 |
$list = array(
array(2,3,5),
array(2,5,24),
array(3,8,6),
array(3,2,10),
array(4,7,20),
array(4,1,15),
array(6,4,10),
array(7,9,20),
);
|
为了方便表达,我把3列数字分别称为,ABC三列
需求:默认以A列排序为主,如果A列相同则以C列倒序排列相同的元素。B列其实没有参与排序,但是在实际运用中有用,所以我也写出来了。
方法一:
代码如下 |
复制代码 |
$a = $c = array();
foreach($list as $val){
$a[] = $val[0]; //a列
$c[] = $val[2]; //c列
}
//安装a列升序,然后安装b列降序 , 类似sql,orderby a asc,b desc
array_multisort($a,SORT_ASC , $c, SORT_DESC, $list);
print_r($list);
|
方法二:
代码如下 |
复制代码 |
for($j=0;$j<count($list);$j++) {
for($i=count($list)-1;$i>$j;$i--){
if($list[$i][0] == $list[$i-1][0] && $list[$i][2] > $list[$i-1][2])
list($list[$i],$list[$i-1]) = array($list[$i-1],$list[$i]);
}
}
|
例子2
例如有下面的数据,从数据库里查出来的,是一个二维数组。
[0] => Array ( [trans_lang_id] => 1 [country_id] => 1 [trans_origin_id] => 1 [page_id] => 1 [trans_content] => test1
[1] => Array ( [trans_lang_id] => 2 [country_id] => 1 [trans_origin_id] => 2 [page_id] => 1 [trans_content] => test2
[2] => Array ( [trans_lang_id] => 3 [country_id] => 1 [trans_origin_id] => 3 [page_id] => 1 [trans_content] => test3
[3] => Array ( [trans_lang_id] => 4 [country_id] => 1 [trans_origin_id] => 4 [page_id] => 1 [trans_content] => test4
[4] => Array ( [trans_lang_id] => 6 [country_id] => 2 [trans_origin_id] => 1 [page_id] => 2 [trans_content] => test5
怎样按照country_id 和page_id分组,将里面的数据查分成多个数组?
也就是country_id和page_id相同的数据成为一个新数组。因为这样的数据会输出到同一个csv文件。
比如文件名为 zh_CN_1.csv。
代码如下 |
复制代码 |
Array Translates:
US_en:Array (
[1] => Array (
[0] => Array ( [0] => test [1] => 测试)
[1] => Array ( [0] => test [1] => 测试)
[2] => Array ( [0] => test [1] => 测试)
[3] => Array ( [0] => test [1] => 测试 )
)
)
CN_zh:Array (
[2] => Array (
[0] => Array ( [0] => There are no user contributed notes for this page. [1] => this belong to another country )
)
)
foreach ($translates as $translate) {
$data[$translate["language_code"] . "_" . $translate['short_name'] ][$translate['page_id']][] = array($translate['content'], $translate['trans_content']);
}
foreach ($data as $locale_key => $item) {
foreach ($item as $page_key => $csvContent) {
$fileName = $locale_key . "_" . $page_key . ".csv";
$translationFile->generateCSV($fileName, $csvContent);
}
这样的话输出的CSV就像下面的结构:
zh_CN_1.csv
zh_CN_2.csv
en_US_1.csv
en_US_2.csv
|
每个csv里面可能有多条数据,就是那些国家语言以及page_id都相同的数据就放在同一个csv里
emlog使用的是文件缓存了,不管文件缓存多好也好不过memcache缓存了,关于memcache缓存优于文件缓存我们就不介绍了,下面简单的看看配置方法吧。
这次只是简单的HACK emlog cache程序,使用memcache缓存,毕竟memcache缓存在内存, 文件缓存在硬盘(要看I/O的性能),一般来说内存的性能大于硬盘,所以一般来说memcache缓存优于文件缓存。
memcache相对于文件缓存的优点:
1、读写性能优异,特别是高并发时和文件缓存比有明显优势。
2、memcached组建支持集群,并且是自动管理负载均衡
注意:memcache的原理是内存分块,单个item大于1M的数据存memcache和读取速度可能有点慢。
具体的情况这边我这里就不测试了,大家可以帮忙测试看看。
[2014-05-25]memcache 1.0beta
1、替换文件缓存为memcache缓存
2、去除文件缓存写入和读取
注意:虽然不涉及数据库操作,但是还是请在修改前备份数据
1、首先添加memcache类文件Mcache.php,放在include/lib文件夹下,服务器地址和端口地址在该文件中,请你自己配置
代码如下 |
复制代码 |
<?php
/**
* 此类为单例模式,取得实例方法: $cache = MCache::getInstance();
* @author Star.Yu <vip@myxzy.com>
* @date 2014.5.25
*
*/
class MCache{
private static $_instance;
private static $_connect_type = '';
private $_memcache;
/**
* 私有化构造函数,禁止使用关键字new来实例Mcache类
*/
private function __construct() {
if (!class_exists('Memcache')) {
throw new Exception('Class Memcache not exists');
}
$conn = self::$_connect_type;
$this->_memcache = new Memcache();
$this->_memcache->$conn('localhost', '11211');
}
/**
* 克隆私有化,禁止克隆实例
*/
private function __clone() {}
/**
* 类入口,通过此静态方法对类进行实例化
*/
public static function getInstance($type = 'connect'){
self::$_connect_type = ($type == 'connect') ? $type : 'pconnect';
if (!self::$_instance instanceof self) {
self::$_instance = new self();
}
return self::$_instance;
}
/**
* 把数据添加到缓存
* @param string $key 缓存的key
* @param string|array|int... $value 缓存的数据
* @param int $flag 使用zlib MEMCACHE_COMPRESSED
* @param int $expire_time 缓存时间
*/
public function set($key, $value,$flag = 0 ,$expire_time = 0){
$this->_memcache->set($key, $value, $flag, $expire_time);
}
/**
* 替换缓存数据
* @param string $key 缓存的key
* @param string|array|int... $value 缓存的数据
* @param int $flag 使用zlib MEMCACHE_COMPRESSED
* @param int $expire_time 缓存时间
*/
public function replace($key, $value,$flag = 0 , $expire_time = 0){
$this->_memcache->replace($key, $value, $flag, $expire_time);
}
/**
* 从缓存读取数据
* @param string|array|int... $key
*/
public function get($key){
return $this->_memcache->get($key);
}
/**
* 从缓存删除数据
* @param string|array|int... $key
*/
public function del($key,$expire_time = 0){
$this->_memcache->delete($key, $expire_time);
}
public function close(){
return $this->_memcache->close();
}
}
|
2、修改include/lib/cache.php,添加实例,第28行修改为
代码如下 |
复制代码 |
private function __construct() {
$this->db = Database::getInstance();
$this->memcache = MCache::getInstance();
} 3、修改include/lib/cache.php的读写memcache缓存,大概507行下面的cacheWrite和readCache函数修改为
/**
* 写入缓存
*/
function cacheWrite ($cacheData, $cacheName) {
$this->memcache->set($cacheName,$cacheData);
}
/**
* 读取缓存文件
*/
function readCache($cacheName) {
if($this->memcache->get($cacheName)===false){call_user_func(array($this, 'mc_' . $cacheName));}
$data = $this->memcache->get($cacheName);
$this->{$cacheName.'_cache'} = unserialize($data);
return $this->{$cacheName.'_cache'};
}
|
到此修改已经完毕,已经缓存了文件缓存到memcache缓存中了,如有什么问题可以留言评论。
卸载方法:如果不想用memcache缓存了,就用原版的cache.php替换掉修改的cache.php,然后删除Mcache.php即可