internal package
Foswiki::Configure::Checker; Base class of all checkers. Checkers give checking and guessing support for configuration values. Checkers are designed to be totally independent of UI.
All 'Value' type configuration items in the model can have a checker. Further, if a value doesn't have an individual checker, there may be an associated type checker. If an item has an individual checker, it's type checker is not invoked. A checker must providecheck_current_value
, as described below.
Checkers never modify $Foswiki::cfg
.
Checker objects are not instantiated directly. Rather, they are generated
using the loadChecker
factory method described below.
StaticMethod
loadChecker($item [, $explicit]) → $checker An item may specify a different checker to load if it has the CHECKER attribute. This will be interpreted as keys for the 'real' checker to lead for this item. This behaviour is suppressed if $explicit is true (i.e. CHECKER will be ignored, and the default behaviour will apply. This is useful in the case where an explicit CHECKER has to chain the other checkers for an item.)
If the item doesn't have a subclass defined, the item's type class may define a generic checker for that type. If so, it is instantiated for this item.
Finally, we will see if $item's type, or one it inherits from has a generic checker. If so, that's instantiated.
Returns the checker that's created or undef if no such checker is found.
Will die if the checker exists but fails to compile.
$item is passed on to the checker's constructor.
ObjectMethod
check_current_value($reporter) $reporter
- report logger; use ERROR, WARN etc on this
object to record information.
The value to be checked is taken from $Foswiki::cfg. This is the baseline check for values already in $Foswiki::cfg, and needs to be as fast as possible (it should not do any heavy processing).
Old checkers may not providecheck_current_value
but instead
use the older signature check
.
Generate a warning if the supplied pathname includes windows-style path separators.
PROVIDED FOR COMPATIBILITY ONLY - DO NOT USE! Use inheritance of Checkers::PATH behaviour instead.
Report the expanded value of a parameter. Return the expanded value.