[Vtigercrm-commits] [Vtiger development] #8164: implement memcached persistent cache
Vtiger development
vtiger-tickets at trac.vtiger.com
Tue Jul 22 13:06:46 GMT 2014
#8164: implement memcached persistent cache
------------------------+------------------------
Reporter: alanbell | Owner: developer
Type: defect | Status: new
Priority: unassigned | Milestone: Unassigned
Component: vtigercrm | Version: 6.0.0
Severity: Medium | Keywords:
------------------------+------------------------
implementing a persistent cache can speed things up quite a lot, it
requires changes to:
includes/runtime/cache/Connectors.php
includes/runtime/cache/Connector.php
Index: includes/runtime/cache/Connectors.php
===================================================================
--- includes/runtime/cache/Connectors.php (revision 14165)
+++ includes/runtime/cache/Connectors.php (working copy)
@@ -7,7 +7,6 @@
* Portions created by vtiger are Copyright (C) vtiger.
* All Rights Reserved.
*************************************************************************************/
-
class Vtiger_Cache_Connector_Memory {
function set($key, $value) {
$this->$key = $value;
@@ -19,4 +18,22 @@
function flush(){
return true;
}
-}
\ No newline at end of file
+}
+class Vtiger_Cache_Connector_Memcached {
+ private $m;
+ function __construct(){
+ $this->m = new Memcached();
+ $this->m->addServer('localhost', 11211);
+ }
+
+ function set($key, $value) {
+ $this->m->set("vtiger$key",$value);
+ }
+ function get($key) {
+ return $this->m->get("vtiger$key");
+ }
+
+ function flush(){
+ return true;
+ }
+}
and in includes/runtime/cache/Connector.php change it to use the new
connector:
$this->connection = new Vtiger_Cache_Connector_Memcached();
this may introduce issues somewhere, but it appears to work great in my
testing
--
Ticket URL: <http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/8164>
Vtiger development <http://trac.vtiger.com/>
Vtiger CRM
More information about the vtigercrm-commits
mailing list