public static function minify($type, $content) { if ($type == 'js') { $content = JSMin::minify($content); } else { $content = Css::minify($content); } return $content; }
/** * Cache the files in the cache storage * @param $key * @param $type */ private function cache($key, $type) { if (!Edge::app()->cache->get($key)) { $content = ''; $valName = sprintf("%sFiles", $type); $arr = array_unique(array_keys($this->{$valName})); foreach ($arr as $file) { $content .= file_get_contents($file) . "\n"; } if ($this->minify) { if ($type == 'js') { $content = JSMin::minify($content); } else { $content = Css::minify($content); } } Edge::app()->cache->add($key, $content); } }