[pmwiki-devel] Updating PTVs

DaveG pmwiki at solidgone.com
Wed Feb 3 16:59:24 CST 2010



On 2/3/2010 4:20 PM, Hans wrote:
> Wednesday, February 3, 2010, 9:10:20 PM, Petko wrote:
>
>> So yes, you may have to either unset all cached PTVs after saving the file and
>> they will be re-cached, or update the cached values.
>
> I think updating is kinder, since the PTV cache would not need to be
> recreated from file.
>
> It is just two lines more in the code:
> one for modified PTVs, one for additional new PTVs
>
> It still leaves a problem for the case when a text replace
> wipes a PTV, but I think this is rather rare and can be ignored,
> for the sake of not needing to recreating the PTV cache.
I suspect BlogIt might be falling foul of this also. The solution is 
then to use Hans's code snippet from the other thread?

  if ($FoxEnablePTVRefresh==1 && is_array($PCache[$pagename])) {
    foreach(array_keys($PCache[$pagename]) as $key)
      if (substr($key,0,3)=='=p_' || $key=='=pagetextvars')
        unset($PCache[$pagename][$key]);
  }


  ~ ~ Dave



More information about the pmwiki-devel mailing list