Dois-je modifier chaque requête de mon application pour pouvoir utiliser Memcached?Comment implémenter Memcached avec PDO
J'utilise cette classe de DB à partir d'un tutoriel AOP:
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 ***/
est-il un bon moyen facile de le modifier pour incorporer Memcached?
duplication possible de [Comment puis-je concevoir un système de cache à l'aide de PDO et memcached?] (http://stackoverflow.com/questions/2600720/comment-je-peux-concevoir-un-cache-system-using-pdo-et-memcached) – RobertPitt
@Robert J'ai lu cette question et son lien, aucun de ceux qui m'a aidé. – bcmcfc