You are here

class RespImgPageCache in Responsive images and styles 7

Hierarchy

Expanded class hierarchy of RespImgPageCache

1 string reference to 'RespImgPageCache'
resp_img_enable in ./resp_img.module
Implements hook_enable().

File

./cache.inc, line 6

View source
class RespImgPageCache extends DrupalDatabaseCache {
  function set($cid, $data, $expire = CACHE_PERMANENT) {
    if ($this
      ->checkCookie()) {
      $cid .= '_' . $_COOKIE[RESP_IMG_COOKIE];
    }
    parent::set($cid, $data, $expire);
  }
  function getMultiple(&$cids) {
    if ($this
      ->checkCookie()) {
      foreach ($cids as $key => $cid) {
        $cids[$key] = $cid . '_' . $_COOKIE[RESP_IMG_COOKIE];
      }
    }
    return parent::getMultiple($cids);
  }
  function clear($cid = NULL, $wildcard = FALSE) {
    if ($this
      ->checkCookie() && !empty($cid) && !$wildcard) {
      if (is_array($cid)) {
        foreach ($cid as $key => $c) {
          $cid[$key] = $c . '_' . $_COOKIE[RESP_IMG_COOKIE];
        }
      }
      else {
        $cid .= '_' . $_COOKIE[RESP_IMG_COOKIE];
      }
    }
    parent::clear($cid, $wildcard);
  }
  function checkCookie() {
    return isset($_COOKIE[RESP_IMG_COOKIE]) && is_numeric($_COOKIE[RESP_IMG_COOKIE]);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DrupalDatabaseCache::$bin protected property
DrupalDatabaseCache::garbageCollection protected function Garbage collection for get() and getMultiple().
DrupalDatabaseCache::get function Implements DrupalCacheInterface::get(). Overrides DrupalCacheInterface::get 1
DrupalDatabaseCache::isEmpty function Implements DrupalCacheInterface::isEmpty(). Overrides DrupalCacheInterface::isEmpty 1
DrupalDatabaseCache::isValidBin function Checks if $this->bin represents a valid cache table.
DrupalDatabaseCache::prepareItem protected function Prepares a cached item.
DrupalDatabaseCache::__construct function Constructs a DrupalDatabaseCache object.
RespImgPageCache::checkCookie function
RespImgPageCache::clear function Implements DrupalCacheInterface::clear(). Overrides DrupalDatabaseCache::clear
RespImgPageCache::getMultiple function Implements DrupalCacheInterface::getMultiple(). Overrides DrupalDatabaseCache::getMultiple
RespImgPageCache::set function Implements DrupalCacheInterface::set(). Overrides DrupalDatabaseCache::set