cross
New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists
This question about Using an extension: Needs followup in Tasks

Attaching the data file

According to FortunePlugin:
The original foswiki file and the related foswiki.dat file can be placed in the fortune database directory. Or attach it to this topic or to another topic identified in the Foswiki configuration.

For easiest system maintenance and upgrades, it is not recommended to modify or attach files to this topic!

I fully agree with the recommendation against attaching files to installed topics (e.g. in the System or Plugins webs). However, I don't see any option in the configuration code to specify a different attachment topic (is the user expected to set a path such as .../foswiki/pub/dir1/dir2/file.dat ?)
# **PATH O**
# Complete path to the Fortune database files.
# If not set, the plugin will use files attached to the System/FortunePlugin topic.
# The default location for the system fortune database files is <tt>/usr/share/fortune/</tt>
$Foswiki::cfg{Plugins}{FortunePlugin}{FortuneDBPath} = '';

It seems to me that another config variable, e.g. of the form $Foswiki::cfg{Plugins}{FortunePlugin}{FortuneDBTopic} would make this much easier.

-- VickiBrown - 31 May 2014

Hi Vicki,

That's a very good suggestion. At the time I worked on the plugin I was thinking more along the lines of different OS locations where packages typically install files. /usr/share/.. or /var/db/....

You are also welcome to fix this yourself. Extension is set to PleaseFeelFreeToModify

-- GeorgeClark - 31 May 2014

Reading a little more about the CPAN:Fortune module, it appears that it can create the binary header on the fly. If the read_header() method is called explicitly and the .dat file does not exist, it will compute the required binary header information.

Unfortunately it doesn't have the ability to write out the header information, so this would be slower than using the precompiled .dat files.

-- GeorgeClark - 31 May 2014
 

QuestionForm edit

Subject Using an extension
Extension FortunePlugin
Version
Status Needs followup in Tasks
Related Topics
Topic revision: r3 - 31 May 2014, GeorgeClark - This page was cached on 17 Jul 2018 - 17:59.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy