private function minifyCSS($file)
{
// create unique filename
$fileName = md5($file) . '.css';
$finalURL = BACKEND_CACHE_URL . '/MinifiedCss/' . $fileName;
$finalPath = BACKEND_CACHE_PATH . '/MinifiedCss/' . $fileName;
// check that file does not yet exist or has been updated already
if (!is_file($finalPath) || filemtime(PATH_WWW . $file) > filemtime($finalPath)) {
// minify the file
$css = new Minify\CSS(PATH_WWW . $file);
$css->minify($finalPath);
}
return $finalURL;
}