/** * * @param type $aArray * @param type $sString * @return boolean */ public static function findExcludes($aArray, $sString, $bScript = FALSE) { foreach ($aArray as $sValue) { if ($bScript) { $sString = JS_Optimize::minify($sString); } if ($sValue && strpos($sString, $sValue) !== FALSE) { return TRUE; } } return FALSE; }
/** * * @param type $sContent * @param type $sUrl */ protected function minifyContent($sContent, $sType, $aUrl) { if ($this->params->get($sType . '_minify', 0) && preg_match('#\\s++#', trim($sContent))) { $sUrl = isset($aUrl['url']) ? $aUrl['url'] : ($sType == 'css' ? 'Style' : 'Script') . ' Declaration'; JCH_DEBUG ? JchPlatformProfiler::mark('beforeMinifyContent - "' . $sUrl . '" plgSystem (JCH Optimize)') : null; $sMinifiedContent = trim($sType == 'css' ? CSS_Optimize::process($sContent) : JS_Optimize::minify($sContent)); if (is_null($sMinifiedContent) || $sMinifiedContent == '') { JchOptimizeLogger::log(sprintf(JchPlatformUtility::translate('Error occurred trying to minify: %s'), $aUrl['url']), $this->params); $sMinifiedContent = $sContent; } JCH_DEBUG ? JchPlatformProfiler::mark('afterMinifyContent - "' . $sUrl . '" plgSystem (JCH Optimize)') : null; return $sMinifiedContent; } return $sContent; }