//img/favicon.ico" type="image/x-icon" /> $time) { $jsChanged = true; break; } } } else { $jsChanged = true; } } else { $jsChanged = true; } // If they have changed, minify them and if($jsChanged) { file_put_contents($jsCacheFile, date("Y-m-d H:i:s",time()).'|'.implode(",", $jsFiles)); $js = ""; foreach($jsFiles as $file) { $js .= \JShrink\Minifier::minify(file_get_contents(dirname(__FILE__).'/js/'.$file)); } file_put_contents(dirname(__FILE__)."/cache/".$CONF['page'].".teknik.min.js", $js); } // Check to see if the CSS files have changed // $cssChanged = false; $cssCacheFile = dirname(__FILE__).'/cache/css_cache_'.$CONF['page'].'.txt'; if (file_exists($cssCacheFile) && file_exists(dirname(__FILE__)."/cache/".$CONF['page'].".teknik.min.css")) { $cache_arr = explode('|', file_get_contents($cssCacheFile)); $time_str = $cache_arr[0]; $files_arr = explode(',', $cache_arr[1]); if (!empty($time_str) && files_arr) { $time = strtotime($time_str); foreach($cssFiles as $file) { if (!in_array($file, $files_arr)) { $cssChanged = true; break; } if(filemtime(dirname(__FILE__)."/css/".$file)>$time) { $cssChanged = true; break; } } } else { $cssChanged = true; } } else { $cssChanged = true; } // If they have changed, minify them and if($cssChanged) { file_put_contents($cssCacheFile, date("Y-m-d H:i:s",time()).'|'.implode(",", $cssFiles)); $css_str = ""; foreach ($cssFiles as $file) { $css_str .= file_get_contents(dirname(__FILE__)."/css/".$file)."\r\n"; } $final_css = compress($css_str); file_put_contents(dirname(__FILE__)."/cache/".$CONF['page'].".teknik.min.css", $css_str); } /* foreach ($cssFiles as $file) { ?> //css/" rel="stylesheet" /> //cache/.teknik.min.css" rel="stylesheet" />