Item13127: Inconsistent documentation on Config.spec for Plugins
Priority: Normal
Current State: Closed
Released In: n/a
Target Release:
Applies To: Engine
Component: Configure, Documentation
Branches: master
Creating a task because I'll never remember to ask otherwise.
DevelopingPlugins documents that settings should live at the top of the
::cfg
hierarchy
$Foswiki::cfg{BathPlugin}{PlugType} = 'Plastic';
HowToWriteASpecFile documents that settings should live under
{Extensions}
ie.
$Foswiki::cfg{Extensions}{ConfigurePlugin}{ExampleKey} = 42;
However everything we ship live under
{Plugins}
and I believe that's where the core looks for the
{Enable}
and
{Module}
parameters.
Doing a grep of the subversion tree, only two use
{Extensions}
one of which seems rather nonsensical.
CKEditorPlugin puts settings under
{Extensions}{GenPDFPisaPlugin}
find . -name Config.spec | xargs grep \{Extensions\}
./GenPDFAddOn/lib/Foswiki/Contrib/GenPDFAddOn/Config.spec:$Foswiki::cfg{Extensions}{GenPDFAddOn}{htmldocCmd} = '';
./DBIStoreContrib/lib/Foswiki/Contrib/DBIStoreContrib/Config.spec:$Foswiki::cfg{Extensions}{DBIStoreContrib}{DSN} = 'dbi:SQLite:dbname=$Foswiki::cfg{WorkingDir}/dbcache';
./DBIStoreContrib/lib/Foswiki/Contrib/DBIStoreContrib/Config.spec:$Foswiki::cfg{Extensions}{DBIStoreContrib}{Username} = '';
./DBIStoreContrib/lib/Foswiki/Contrib/DBIStoreContrib/Config.spec:$Foswiki::cfg{Extensions}{DBIStoreContrib}{Password} = '';
./DBIStoreContrib/lib/Foswiki/Contrib/DBIStoreContrib/Config.spec:$Foswiki::cfg{Extensions}{DBIStoreContrib}{SQLite}{PCRE} = '/usr/lib/sqlite3/pcre.so';
./DBIStoreContrib/lib/Foswiki/Contrib/DBIStoreContrib/Config.spec:$Foswiki::cfg{Extensions}{DBIStoreContrib}{AutoloadUnknownMETA} = 0;
./DBIStoreContrib/lib/Foswiki/Contrib/DBIStoreContrib/Config.spec:$Foswiki::cfg{Extensions}{DBIStoreContrib}{Schema} = {
./CKEditorPlugin/lib/Foswiki/Plugins/CKEditorPlugin/Config.spec:$Foswiki::cfg{Extensions}{GenPDFPisaPlugin}{xhtml2pdf} = '/usr/local/bin/xhtml2pdf';
./CKEditorPlugin/lib/Foswiki/Plugins/CKEditorPlugin/Config.spec:$Foswiki::cfg{Extensions}{GenPDFPisaPlugin}{useextcss} = $TRUE;
./CKEditorPlugin/lib/Foswiki/Plugins/CKEditorPlugin/Config.spec:$Foswiki::cfg{Extensions}{GenPDFPisaPlugin}{extcssfile} = '';
./CKEditorPlugin/lib/Foswiki/Plugins/CKEditorPlugin/Config.spec:$Foswiki::cfg{Extensions}{GenPDFPisaPlugin}{extcssfileNum} = '';
--
GeorgeClark - 01 Dec 2014
Looking at
lib/Foswiki/Plugins.pm
, we look for {Plugins} only for the enabled flag.
Dunno what you want from me. It's namespace soup.
FWIW, my opinion, to avoid polluting namespaces:
{Plugins} should
only be used for the {Module} and {Enabled}
{Extensions} is used for
everything else. Plugins are Extensions. So are Contribs.
Can we persuade everyone of this? I doubt it.
--
CrawfordCurrie - 02 Dec 2014