Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://wiki.cs.msu.ru/System/PerlDoc?module=Foswiki::Configure::Checker
Дата изменения: Unknown Дата индексирования: Tue Apr 12 01:01:25 2016 Кодировка: koi8-r |
internal package
Foswiki::Configure::Checker internal package
Foswiki::Configure::Checker; is a
Foswiki::Configure::UI Base class of all checkers. Checkers give checking and guessing support for configuration values. Most of the methods of this class are intended to be protected i.e. only available to subclasses.
ObjectMethod
check($value) → $html Entry point for the value check. Overridden by subclasses.
Returns html formatted by $this->ERROR(), WARN(), NOTE(), or hand made OR an empty string. The output of a checker will normally be included in an HTML table, so don't get too carried away.$this->guessed(0)
(passing 1 if the guess was an error).
ObjectMethod
getCfg($name) → $expanded_val Any embedded references to other Foswiki::cfg vars will be expanded.
Generate a warning if the supplied pathname includes windows-style path separators.
Try and guess the path of one of the major directories, by looking relative to the absolute pathname of the dir where configure is being run.
Return the expanded value of a parameter as a note for display.
Perform a recursive check of the specified path. The recursive check is limited to the configured "PathCheckLimit". This prevents excessive delay on installations with large data or pub directories. The count of files checked is available in the class method $this->{fileCount}
$perms is a string of permissions to check:
Basic checks:All failures of the basic checks are reported back to the caller.
Enhanced checks:If > 20 enhanced errors are encountered, reporting is stopped to avoid excessive errors to the administrator. The count of enhanced errors is reported back to the caller by the object variable: $this->{fileErrors}
In addition to the basic and enhanced checks specified in the $perms string, Directories are always checked to determine if they have the 'x' permission.
$filter is a regular expression. Files matching the supplied regex if present will not be checked. This is used to skip rcs,v or .txt files because they have different permission requirements.
Note that the enhanced checks are important especially on hosted sites. In some environments, the Foswiki perl scripts run under a different user/group than the web server. Basic checks will pass, but the server may still be unable to access the file. The enhanced checks will detect this condition.
Callers of this checker should reset $this->{fileCount} and $this->{fileErrors} to zero before calling this routine.
checkTreePerms
.
Returns a message or the empty string if the check passed.
Check for the availability of a GNU program.
Since Windows (without Cygwin) makes it hard to capture stderr ('2>&1' works only on Win2000 or higher), and Windows will usually have GNU tools in any case (installed for Foswiki since there's no built-in diff, grep, patch, etc), we only check for these tools on Unix/Linux and Cygwin.