"assets_output" write wrong cache file name
hello,
related to Enabling "assets_output" produces wrong path.
#355 on github.
my asset config is set to :
$config['assets_folders'] = array(
'images' => 'images/',
'css' => 'css/',
'js' => 'js/',
'pdf' => 'pdf/',
'swf' => 'swf/',
'media' => 'media/',
'captchas' => 'captchas/',
'docs' => 'docs/',
'cache' => 'cache/'
);
$config['assets_cache_folder'] = 'cache';
and my folder assets/cache is writable
but assets_output write a filename like this :
/assets/cache/cachec8619d864111a453871197ad44d0e6f0_1456819202.php
in my source html file everything seems ok :
href="/assets/cache/c8619d864111a453871197ad44d0e6f0_1456819202.php"
i modified fuel/libraries/Asset.php after line number 540 like this:
$path = ('cache' === $path) ? WEB_ROOT . $assets_path . $asset_type : WEB_ROOT . $assets_path . $asset_type . $file;
and now it works fine...
could this change cause other consequences otherwise that I do not see ?
another option i imagined is to modify in fuel/libraries/Asset.php in 1129 :
$cache_dir = $this->assets_server_path($this->assets_cache_folder, 'cache', $module);
what's the best solution ? Or does it exist another thing to do ?
thank you for any suggestion or response.
have a nice day.
Comments
https://github.com/daylightstudio/FUEL-CMS/tree/develop
the written file in assets/cache is named like this
cache53fe7151c0bafa59f1e25d6e6a1df1fc_1456873200.php
and the link href : 53fe7151c0bafa59f1e25d6e6a1df1fc_1456873200.php
https://github.com/daylightstudio/FUEL-CMS/commit/60da8c6d93f895f833ecbbd0e39e654f9055d71a
but i tried this before starting this thread : it doesn't write anything in the assets_cache_folder...
before i posted, i worked around a little and the simplest way i found was :
in Asset.php:540
$path = ('cache' === $path) ? WEB_ROOT . $assets_path . $asset_type : WEB_ROOT . $assets_path . $asset_type . $file;
but i'm not sure of the consequences on other parts.
by the way i am very pleased to work with fuelcms for few years now. it's the best solution for my works.
thank you.
$config['assets_cache_folder'] = 'cache/';
I've pushed a fix for this to account for with or without since by default it is without.
https://github.com/daylightstudio/FUEL-CMS/commit/5845651aedb2888b2a88ce66d981e3936cf95b3c
1- $config['assets_cache_folder'] = 'cache/'; produces links with href to the assets directory root and no cache file in assets directory root (no writable)
2- $config['assets_cache_folder'] = 'cache'; produces the right links to assets/cache/ with no cache file in both assets or assets/cache directories
Sorry.
Don't spend time about this for me. I can wait with my workaround above.