Skip to content

Commit

Permalink
Fix LESS cache for theme
Browse files Browse the repository at this point in the history
  • Loading branch information
joomlart committed Feb 5, 2013
1 parent 89000f8 commit 7d3564c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/plg_system_t3/includes/core/less.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,14 @@ function buildCss ($path) {
$app = JFactory::getApplication();
// get vars last-modified
$vars_lm = $app->getUserState('vars_last_modified', 0);
$theme = $app->getUserState('vars_theme', '');

// less file last-modified
$filepath = JPATH_ROOT.'/'.$path;
$less_lm = filemtime ($filepath);

// get css cached file
$cssfile = T3_DEV_FOLDER.'/'.str_replace('/', '.', $path).'.css';
$cssfile = T3_DEV_FOLDER.'/' . ($theme ? $theme . '/' : '') .str_replace('/', '.', $path).'.css';
$cssurl = JURI::base(true).'/'.$cssfile;
$csspath = JPATH_ROOT.'/'.$cssfile;
if (is_file ($csspath) && filemtime($csspath) > $less_lm && filemtime($csspath) > $vars_lm) {
Expand Down

0 comments on commit 7d3564c

Please sign in to comment.