Page 1 of 1

Template externalizer with User Tags and Cache problems

Posted: Thu Jul 08, 2010 8:59 pm
by jurkapavel
Hi,

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();
This code save user tag to database.

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);
    }
Same code is working for Templates, Stylesheets and Global Content Blocks.

Source code is attached. Saving User Tags is on line 283.

Do you have any idea how to fix this bug?