[dokuwiki] Re: Recent changes & import update

On 23 October at 11:30, Ben Coburn wrote:

> I'll look into changing the code for importing the old changelog so 
> that it puts all the old changes into the recent changes cache. The 
> changelog trimmer (in the indexer) will then cut the recent changes 
> cache down to size on the first run. This will also give people a whole 
> 24 hours to set $conf['recent_days'] to the "right" value for their 
> wiki.

  Hmmm, seems I forgot the action of the trimmer which will shrink the
  cache anyway. I don't think having 24 hours to change recent_days is
  a user (or admin) friendly solution. So here is an other scenario to
  keep at least 20 (or whatever $conf['recent'] value is set to)
  entries after importing the changes.

  From the existing changes.log which gets imported, we can determine
  which value of $conf['recent_days'] would be required to output at
  least $conf['recent'] entries in the changelog by reading the entry
  on the $conf['recent'] line before last line in changes.log. In a
  shell way, with $conf['recent'] = 20, this is:

  ~$ tail -20 www/current3/data/changes.log | head -1 | cut -f1
  1148070072

  so $conf['recent_days'] should be (`date +%s` - 1148070072)/36400
  which is 372 days! Thus I'd see importchangelog plugin store this
  value in its lib/plugins/importoldchangelog dir if $conf['recent']
  is not set (i.e. defaults to a value of 7 days) and the trimmer use
  this value as long as $conf['recent'] has not been set in local.php
  config file. People who have changed $conf['recent'] already did it
  because their wiki changes a lot or rarely.
  
  We could even go a step further and decide that if the calculated
  $conf['recent_days'] (needed to have $conf['recent'] entries in the
  changes cache) and the (default) value set for $conf['recent_days']
  in the config differ too much, the trimmer uses the calculated value
  stored by importoldchangelog in the lib/plugins/... dir. But this is
  maybe too invasive.

  What do you think?

-- 
  bug

-- 
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: