/** * Get currently configured design package. * Depends on design exception rules configuration and browser user agent * * return string|bool */ protected function _getDesignPackage() { $cacheInstance = Enterprise_PageCache_Model_Cache::getCacheInstance(); $exceptions = $cacheInstance->load(self::DESIGN_EXCEPTION_KEY); $this->_designExceptionExistsInCache = $cacheInstance->getFrontend()->test(self::DESIGN_EXCEPTION_KEY); if (!$exceptions) { return false; } $rules = @unserialize($exceptions); if (empty($rules)) { return false; } return Mage_Core_Model_Design_Package::getPackageByUserAgent($rules); }
/** * Get currently configured design package. * Depends on design exception rules configuration and browser user agent * * return string|bool */ protected function _getDesignPackage() { $cacheInstance = Enterprise_PageCache_Model_Cache::getCacheInstance(); $exceptions = $cacheInstance->load(self::DESIGN_EXCEPTION_KEY); $this->_designExceptionExistsInCache = $cacheInstance->getFrontend()->test(self::DESIGN_EXCEPTION_KEY); if (!$exceptions) { return false; } $exceptions = @unserialize($exceptions); if (!is_array($exceptions)) { return false; } if (isset($_COOKIE[Mage_Core_Model_Store::COOKIE_NAME])) { $storeIdentifier = $_COOKIE[Mage_Core_Model_Store::COOKIE_NAME]; } else { $storeIdentifier = Mage::app()->getRequest()->getHttpHost() . Mage::app()->getRequest()->getBaseUrl(); } if (!isset($exceptions[$storeIdentifier])) { return false; } $keys = array(); foreach ($exceptions[$storeIdentifier] as $type => $exception) { $rule = @unserialize($exception); if (is_array($rule)) { $keys[] = Mage_Core_Model_Design_Package::getPackageByUserAgent($rule, $type); } else { $keys[] = ''; } } return implode($keys, "|"); }