I'm developing a new version of Template Externalizer module with support for Global Content Blocks and User Defined Tags.
I have problem with saving User Defined Tags. When I reload the frontend page, module detects change of file and upload new version of User Defined Tag to database, but the output is old. When I reload page again the output is new.
I was trying to clear cache with this code but without result.
Code: Select all
global $gCms;
$contentops =& $gCms->GetContentOperations();
$contentops->ClearCache();
Code: Select all
$userplugin_name = $tags->fields['userplugin_name'];
if($ftime > $modified_date && ($fsize = filesize($fname)) != 0) {
$fsize = filesize($fname);
$fp = fopen($fname, 'r');
$code = trim(str_ireplace('<?php', '', fread($fp, $fsize)));
$uo->SetUserTag($userplugin_name, $code);
fclose($fp);
}
Source code is attached. Saving User Tags is on line 283.
Do you have any idea how to fix this bug?