public static function QPCache::has in QueryPath 6
Same name and namespace in other branches
- 7.3 qpcache/qpcache.module \QPCache::has()
- 7.2 qpcache/qpcache.module \QPCache::has()
Return true if the cache has this key.
1 call to QPCache::has()
- qpcache_has in qpcache/
qpcache.module - Check if given key exists.
File
- qpcache/
qpcache.module, line 202 - The main file for qpcache.
Class
- QPCache
- This is a special-purpose XML cache.
Code
public static function has($key) {
list($crc, $hash) = self::genMultiKey($key);
$now = time();
$sql = 'SELECT COUNT(hashkey) FROM {qpcache_xmlcache} WHERE crckey=%d AND hashkey=\'%s\' AND (expire = 0 OR expire > %d)';
return db_result(db_query($sql, $crc, $hash, $now)) > 0;
}