Changeset 11844
- Timestamp:
- 08/30/07 10:23:04 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/midcom.core/midcom/core/querybuilder.php
r11566 r11844 15 15 */ 16 16 17 class midcom_core_querybuilder_cached { 17 class midcom_core_querybuilder_cached 18 { 18 19 /** 19 20 * The timeout to use for this cache … … 24 25 protected $cache = null; 25 26 26 function __construct ($cache = FALSE) { 27 if ($cache === FALSE) { 27 function __construct ($cache = FALSE) 28 { 29 if ($cache === FALSE) 30 { 28 31 $this->cache = $_MIDCOM->cache->memcache; 29 } else { 32 } 33 else 34 { 30 35 $this->cache = $cache; 31 36 } … … 36 41 * Note: With large lists of inputs, the key becomes very loong... 37 42 */ 38 function rec_implode($key, $val) { 43 function rec_implode($key, $val) 44 { 39 45 $this->new_key .= "{$key}_$val"; 40 46 } … … 43 49 * Makes sure that all calls are catched. 44 50 * */ 45 function __call($name, $args) { 51 function __call($name, $args) 52 { 46 53 if ($this->qb == NULL) 47 54 { … … 60 67 * Executes the query and saves it to memcached 61 68 */ 62 function execute() { 69 function execute() 70 { 63 71 $key = "midcom_querybuilder_cache_{$this->qb->classname}" . implode($this->key , "_"); 64 72 65 73 $return = $this->cache->get($key); 66 if ($return) { 74 if ($return) 75 { 67 76 return $return; 68 77 }
