To solve this I've added the full path to the compressed CSS/JS file on store_file function like this
- Code: Select all
if(!function_exists('store_file')){
function store_file($data, $filename, $overwrite = false) {
$path = JPATH_ROOT . DS . 'cache' . DS . 'gk';
jimport('joomla.filesystem.folder');
if (!is_dir($path)) JFolder::create($path);
$path = $path . DS . $filename;
$url = JURI::base(true) .DS. 'cache'. DS .'gk' . DS. $filename;
if (is_file($path) && !$overwrite) return $url;
JFile::write($path, $data);
return is_file($path) ? $url : false;
}
}
Added JPATH_ROOT . DS . to the first $path assignment.