[eluser]fgrehm[/eluser]
On the _add method we've got these lines:
Code:
if ($fileinfo['extension'] === 'js' || $fileinfo['extension'] === 'css') {
$this->_assets[$fileinfo['extension']][$group][$file_path] = file_get_contents($file);
if (!in_array($group,$this->asset_groups[$fileinfo['extension']]))
$this->asset_groups[$fileinfo['extension']][] = $group;
}
I think '
file_get_contents' should only be called when the resulting cache file doesn't exists. The way it is, we read file contents even if the cache exists.
This is the way i think it should be done:
- Add js / ccs path to
$this->_assets array (only the file path and not its contents)
- When
output($type) method is called, the hash is calculated
- If the cache file doesn't exists, read all assets contents and generate it
I hope you undertand now
Fabio
PS: Sorry about my english, it's been a while since I wrote something in english