You are here

function ad_cache_memcache_get_ad in Advertisement 6

Same name and namespace in other branches
  1. 5.2 cache/memcache/ad_cache_memcache.inc \ad_cache_memcache_get_ad()
  2. 5 cache/memcache/ad_cache_memcache.inc \ad_cache_memcache_get_ad()
1 call to ad_cache_memcache_get_ad()
ad_cache_memcache in cache/memcache/ad_cache_memcache.inc
Called by adserve.inc, display an ad from memcache.

File

cache/memcache/ad_cache_memcache.inc, line 175
Memcache include.

Code

function ad_cache_memcache_get_ad($aid) {
  static $load = FALSE;
  $ad = ad_memcache_get("ad-aid-{$aid}");
  if (!$load && !is_object($ad)) {
    $load = TRUE;
    adserve_bootstrap();
    $ad_memcache_build = variable_get('ad_memcache_build', '');
    if (time() - $ad_memcache_build >= 60) {
      ad_cache_memcache_build();
    }
  }
  return $ad;
}