ndeet / plg_system_less

A Joomla! system plugin to compile .less files on the fly.
GNU Lesser General Public License v3.0
17 stars 13 forks source link

When changing template old cache file is used #3

Closed ghost closed 12 years ago

ghost commented 12 years ago

Hello, I installed Joomla 3 - Plugin - Less Compiler when template protostar was active. I copied protostar to a new template named protostarghsvs and activated it. In plugin settings I selected "Yes" for option "Force compiling". After changing my new template.less I couldn't see any changes in newly created template.css. But changing template.less in inactive protostar changed my new template.css.

Reason is old cache file template.less.cache that's called in lines

if (file_exists($cacheFile)) { $cache = unserialize(file_get_contents($cacheFile)); } else { $cache = $inputFile; }

instead of $inputFile.

Thanks for this plugin!!

ndeet commented 12 years ago

Hi illovo,

thank you for reporting. I will try to replicate this behavoir. Altough, if you enabled the "force compiling" option the cache file should be ignored. I will check that.

ghost commented 12 years ago

Danke für Antwort, nein, der Cachefile wird nicht ignoriert. Ist keine Condition drin, die Cachefile auf "force compiling" prüft.

Siehe:

function autoCompileLess($inputFile, $outputFile) { // load config file $configFile = JPATH_BASE . DIRECTORY_SEPARATOR . 'configuration.php'; $config = JFactory::getConfig($configFile); $tmpPath = $config->get('tmp_path');

//load chached file $cacheFile = $tmpPath . DIRECTORY_SEPARATOR . basename($inputFile) . ".cache";

if (file_exists($cacheFile)) { $cache = unserialize(file_get_contents($cacheFile)); } else { $cache = $inputFile; } ....

Danke noch mal fürs Plugin. Spart extrem Arbeit!

Am 18.11.2012 10:35, schrieb Andreas Tasch:

Hi illovo,

thank you for reporting. I will try to replicate this behavoir. Altough, if you enabled the "force compiling" option the cache file should be ignored. I will check that.

— Reply to this email directly or view it on GitHub https://github.com/ndeet/plg_system_less/issues/3#issuecomment-10484188.

ndeet commented 12 years ago

Danke für den Bugreport,

das Problem ist dass die Cache-Datei als template.less.cache abgelegt wird und dann nach dem Templatewechsel vorhanden ist und falsche Infos enthält. Habe jetzt die .cache Datei um den Template-Namen erweitert und es sollte jetzt funktionieren. Neue version kommt in ein paar Minuten.

Danke!