mobile_detect_caching_alter_cid() . $cid; parent::set($cid, $data, $expire); } /** * {@inheritdoc} */ function getMultiple(&$cids) { if (is_array($cids)) { foreach ($cids as $key => $cid) { $cids[$key] = $this->mobile_detect_caching_alter_cid() . $cid; } } return parent::getMultiple($cids); } /** * Determines a prefix for the page cache $cid based on devide type. * * @return string * The $cid prefix */ protected function mobile_detect_caching_alter_cid() { $device = ''; if (class_exists('Mobile_Detect')) { try { $detect = new Mobile_Detect(); if (($detect->isMobile()) && ($detect->isTablet() == FALSE)) { $device = 'mobile:'; } elseif ($detect->isTablet()) { $device = 'tablet:'; } } catch (Exception $e) { // nop } } return $device; } }