使用Yii CMemCache时忽略服务器关闭错误消息 [英] Ignoring Server Down Error Message when using Yii CMemCache

查看:109
本文介绍了使用Yii CMemCache时忽略服务器关闭错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已启用yii memcached,当专用的memcached服务器关闭时,如何忽略此错误.

I've enabling yii memcached, How do I ignoring this error when dedicated memcached server was down.

MemcachePool :: get():服务器192.168.1.200(tcp 11211,udp 0)失败 使用:由于目标计算机处于活动状态,因此无法建立连接 拒绝了. (10061)

MemcachePool::get(): Server 192.168.1.200 (tcp 11211, udp 0) failed with: No connection could be made because the target machine actively refused it. (10061)

谢谢

推荐答案

您可以:

  1. CMemCache 扩展为您自己的缓存组件
  2. 如果没有连接,则覆盖getter和setter以返回false 存在或连接无效,否则调用parent ::等效方法(传递任何必要的参数)
  3. 配置应用程序组件缓存以使用新扩展的 版本的CMemCache
  1. extend CMemCache as your own caching component
  2. override the getters and setters to return false if no connection is present or connection isn't active, otherwise call the parent:: equivalent method (with any necessary parameters passed)
  3. configure the application component cache to use your newly extended version of CMemCache

这篇关于使用Yii CMemCache时忽略服务器关闭错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆