Memcachedを使用するには、アプリケーション内のすべてのクエリを1つずつ変更する必要がありますか?MemcachedをPDOで実装する方法
私はPDOのチュートリアルからこのDBクラスを使用しています:
class DB {
private static $host;
private static $dbName;
private static $user;
private static $password;
/*** Declare instance ***/
private static $instance = NULL;
/**
*
* the constructor is set to private so
* so nobody can create a new instance using new
*
*/
private function __construct() {}
/**
*
* Return DB instance or create intitial connection
* @return object (PDO)
* @access public
*
*/
public static function getInstance() {
if (!self::$instance){
self::$instance = new PDO("mysql:host=".self::$host.";dbname=".self::$dbName, self::$user, self::$password);
self::$instance-> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
return self::$instance;
}
/**
*
* Like the constructor, we make __clone private
* so nobody can clone the instance
*
*/
private function __clone(){}
} /*** end of class ***/
は、Memcachedのを組み込むために、それを修正するのすてきな簡単な方法はありますか?
[私はPDOとmemcachedを使ってキャッシュシステムを設計する方法は?](http://stackoverflow.com/questions)/2600720/how-i-can-design-a-cache-system-using-pdo-and-memcached) – RobertPitt
@Robert私はその質問とそのリンクを読んでいます。 – bcmcfc