/** * Make a unique cache id for for this request. * * Any settings that could affect output are taken into consideration * * @param string $prefix * * @return string */ protected static function _getCacheId($prefix = 'minify') { $name = preg_replace('/[^a-zA-Z0-9\\.=_,]/', '', self::$_controller->selectionId); $name = preg_replace('/\\.+/', '.', $name); $name = substr($name, 0, 200 - 34 - strlen($prefix)); $md5 = md5(serialize(array(Minify_Source::getDigest(self::$_controller->sources), self::$_options['minifiers'], self::$_options['minifierOptions'], self::$_options['postprocessor'], self::$_options['bubbleCssImports'], self::VERSION))); return "{$prefix}_{$name}_{$md5}"; }
/** * Analyze sources (if there are any) and set $options 'contentType' * and 'lastModifiedTime' if they already aren't. * * @param array $options options for Minify * * @return array options for Minify */ public final function analyzeSources($options = array()) { if ($this->sources) { if (!isset($options['contentType'])) { $options['contentType'] = Minify_Source::getContentType($this->sources); } // last modified is needed for caching, even if setExpires is set if (!isset($options['lastModifiedTime'])) { $max = 0; foreach ($this->sources as $source) { $max = max($source->lastModified, $max); } $options['lastModifiedTime'] = $max; } } return $options; }
/** * Make a unique cache id for for this request. * * Any settings that could affect output are taken into consideration * * @return string */ protected static function _getCacheId() { return md5(serialize(array( Minify_Source::getDigest(self::$_controller->sources) ,self::$_options['minifiers'] ,self::$_options['minifierOptions'] ,self::$_options['postprocessor'] ,self::$_options['bubbleCssImports'] ))); }
/** * @inheritdoc */ public function __construct(array $spec, Minify_CacheInterface $cache) { parent::__construct($spec); $this->cache = $cache; }
/** * Make a unique cache id for for this request. * * Any settings that could affect output are taken into consideration * * @param string $prefix * * @return string */ protected static function _getCacheId($prefix = 'minify') { // BEGIN BWP Minify Customization if (!empty(self::$cacheId)) { return self::$cacheId; } // switch cache path and create new directory if needed, this is for // multisite compatible, this is reserved for future version if (!empty($blog_id) && 1 == 2) { global $min_cacheFileLocking, $min_cachePath; $blog_dir = str_pad($blog_id, 4, '0', STR_PAD_LEFT); $cache_dir = $min_cachePath . '/' . $blog_dir; // only switch to blog cache dir if it has been set, if not we // let Minify handle the cache dir if (!empty($min_cachePath)) { if (!file_exists($cache_dir)) { mkdir($cache_dir, 0755); } self::setCache($cache_dir, $min_cacheFileLocking); } } // END BWP Minify Customization $name = preg_replace('/[^a-zA-Z0-9\\.=_,]/', '', self::$_controller->selectionId); $name = preg_replace('/\\.+/', '.', $name); $name = substr($name, 0, 100 - 34 - strlen($prefix)); $md5 = md5(serialize(array(Minify_Source::getDigest(self::$_controller->sources), self::$_options['minifiers'], self::$_options['minifierOptions'], self::$_options['postprocessor'], self::$_options['bubbleCssImports'], self::VERSION))); return "{$prefix}_{$name}_{$md5}"; }
/** * Make a unique cache id for for this request. * * Any settings that could affect output are taken into consideration * * @return string */ protected static function _getCacheId() { $requestURI = @$_SERVER['REQUEST_URI']; return md5(serialize(array(Minify_Source::getDigest(self::$_controller->sources), self::$_options['minifiers'], self::$_options['minifierOptions'], self::$_options['postprocessor'], self::$_options['bubbleCssImports'], $requestURI))); }
/** * Make a unique cache id for for this request. * * Any settings that could affect output are taken into consideration * * @param string $prefix * * @return string */ protected static function _getCacheId($prefix = 'minify') { $name = preg_replace('/[^a-zA-Z0-9\\.=_,]/', '', self::$_controller->selectionId); $name = preg_replace('/\\.+/', '.', $name); /******************** Hack by Simon ***************************** * Reduced the length of the cache file name here, as on Windows systems, the full path to a file is * limited to 200-250ish characters (yeah, dumb!) * So just making it shorter here. The md5 should still prevent conflicts (I'm hoping!) ****************************************************************/ $name = substr($name, -140 + 34 + strlen($prefix)); /****************************************************************/ $md5 = md5(serialize(array(Minify_Source::getDigest(self::$_controller->sources), self::$_options['minifiers'], self::$_options['minifierOptions'], self::$_options['postprocessor'], self::$_options['bubbleCssImports'], self::VERSION))); return "{$prefix}_{$name}_{$md5}"; }