1<?php 2 3class memcache_wincache implements memcache_interface{ 4 public static function init() {} 5 6 public static function driver(){ return "wincache";} 7 8 public static function emulated() { return false; } 9 10 public static function add($key, $val,$ttl = 0){ 11 if (MEMCACHE_CHECK_KEYS && !is_string($key)) trigger_error("The key needs to be string! (note: not even numbers are accepted)",E_USER_ERROR); 12 return wincache_ucache_add($key,$val,$ttl); 13 } 14 15 public static function set($key, $val,$ttl = 0){ 16 if (MEMCACHE_CHECK_KEYS && !is_string($key)) trigger_error("The key needs to be string! (note: not even numbers are accepted)",E_USER_ERROR); 17 return wincache_ucache_set($key,$val,$ttl); 18 } 19 20 public static function exists($key){ 21 if (MEMCACHE_CHECK_KEYS && !is_string($key)) trigger_error("The key needs to be string! (note: not even numbers are accepted)",E_USER_ERROR); 22 return wincache_ucache_exists ($key); 23 } 24 25 public static function del($key){ 26 if (MEMCACHE_CHECK_KEYS && !is_string($key)) trigger_error("The key needs to be string! (note: not even numbers are accepted)",E_USER_ERROR); 27 return wincache_ucache_delete ($key); 28 } 29 public static function get($key,&$success = false){ 30 if (MEMCACHE_CHECK_KEYS && !is_string($key)) trigger_error("The key needs to be string! (note: not even numbers are accepted)",E_USER_ERROR); 31 return wincache_ucache_get ($key, $success); 32 } 33 34 public static function clear(){ 35 return wincache_ucache_clear(); 36 } 37 38} 39 40memcache_wincache::init();