public static function min_html_end() { $pageContent = ob_get_contents(); ob_end_clean(); Loader::library("minco", "mainio_minco"); $m = Minco::getInstance(); echo $m->minify($pageContent); }
protected function _endBlock($writeTemplate = false) { if (!$this->_blockStarted) { throw new Exception(t("Cannot end block before starting it!")); } $bt = debug_backtrace(); $file = $bt[1]['file']; $line = $bt[1]['line']; $this->_endFile = $file; $this->_endLine = $line; $content = ob_get_contents(); ob_end_clean(); $this->_blockStarted = false; $cachedContent = false; if (!MINCO_BYPASS_CACHE) { $cachedContent = Cache::get('minco_combined_content', $this->_cacheID); } if ($cachedContent === false) { // Run the combine if ($writeTemplate) { $this->_combineOptions['writeFiles'] = true; } $m = Minco::getInstance(); $content = $m->combine($content, $this->_combineOptions); Cache::set('minco_combined_content', $this->_cacheID, $content); } else { $content = $cachedContent; } if ($writeTemplate) { $this->_rewriteTemplates($content); } echo $content . PHP_EOL; }