log hit/miss when DEBUG_CACHE is on
This commit is contained in:
		
							parent
							
								
									dfba656355
								
							
						
					
					
						commit
						1c60942730
					
				| @ -295,10 +295,11 @@ class MemcacheCache implements CacheEngine { | ||||
| 	 */ | ||||
| 	public function get($key) { | ||||
| 		assert(!is_null($key)); | ||||
| 		if((DEBUG_CACHE === true) || (is_null(DEBUG_CACHE) && @$_GET['DEBUG_CACHE'])) { | ||||
| 			file_put_contents("data/cache.log", "Cache lookup: $key\n", FILE_APPEND); | ||||
| 		} | ||||
| 		$val = $this->memcache->get($key); | ||||
| 		if((DEBUG_CACHE === true) || (is_null(DEBUG_CACHE) && @$_GET['DEBUG_CACHE'])) { | ||||
| 			$hit = $val === false ? "miss" : "hit"; | ||||
| 			file_put_contents("data/cache.log", "Cache $hit: $key\n", FILE_APPEND); | ||||
| 		} | ||||
| 		if($val !== false) { | ||||
| 			$this->hits++; | ||||
| 			return $val; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user