Memcached를 사용하려면 응용 프로그램의 모든 단일 쿼리를 수정해야합니까?PDO로 Memcached를 구현하는 방법
내가 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
@ 로버트 그 질문과 그 링크를 읽었습니다. – bcmcfc