function adserve_cache_get_cache in Advertisement 6.2
Same name and namespace in other branches
- 5.2 adcache.inc \adserve_cache_get_cache()
- 6.3 adcache.inc \adserve_cache_get_cache()
- 7 adcache.inc \adserve_cache_get_cache()
Build and return the cache. TODO: It's expensive to build the cache each time we serve an ad, this should be cached in the database, not in a static.
File
- ./
adcache.inc, line 153
Code
function adserve_cache_get_cache($data = NULL) {
static $cache = NULL;
// if we don't the the cache yet, build it
if (is_null($cache)) {
$cache = module_invoke_all('ad_build_cache');
}
if ($data) {
if (isset($cache[$data])) {
return $cache[$data];
}
else {
return NULL;
}
}
return $cache;
}