~kosova/+junk/tuxfamily-twiki

« back to all changes in this revision

Viewing changes to foswiki/lib/Foswiki/Configure/Checkers/WarningFileName.pm

  • Committer: James Michael DuPont
  • Date: 2009-07-18 19:58:49 UTC
  • Revision ID: jamesmikedupont@gmail.com-20090718195849-vgbmaht2ys791uo2
added foswiki

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# See bottom of file for license and copyright information
 
2
package Foswiki::Configure::Checkers::WarningFileName;
 
3
use base 'Foswiki::Configure::Checker';
 
4
 
 
5
use strict;
 
6
 
 
7
use Foswiki::Configure::Checker;
 
8
use Foswiki::Configure::Load;
 
9
 
 
10
sub check {
 
11
    my $this = shift;
 
12
 
 
13
    if (   $Foswiki::cfg{WarningFileName}
 
14
        && $Foswiki::cfg{WarningFileName}!~/^NOT SET/ )
 
15
    {
 
16
        my $logFile = $Foswiki::cfg{WarningFileName} || "";
 
17
        $logFile =~ s/%DATE%/DATE/;
 
18
        Foswiki::Configure::Load::expandValue($logFile);
 
19
        my $e = $this->checkCanCreateFile($logFile);
 
20
        $e = $this->ERROR($e) if $e;
 
21
        return $e;
 
22
    }
 
23
    else {
 
24
        $Foswiki::cfg{WarningFileName} =~ s/^NOT SET/$Foswiki::cfg{DataDir}/g;
 
25
        return $this->guessed(0);
 
26
    }
 
27
    return '';
 
28
}
 
29
 
 
30
1;
 
31
__DATA__
 
32
#
 
33
# Foswiki - The Free and Open Source Wiki, http://foswiki.org/
 
34
#
 
35
# Copyright (C) 2008 Foswiki Contributors. All Rights Reserved.
 
36
# Foswiki Contributors are listed in the AUTHORS file in the root
 
37
# of this distribution. NOTE: Please extend that file, not this notice.
 
38
#
 
39
# Additional copyrights apply to some or all of the code in this
 
40
# file as follows:
 
41
#
 
42
# Copyright (C) 2000-2006 TWiki Contributors. All Rights Reserved.
 
43
# TWiki Contributors are listed in the AUTHORS file in the root
 
44
# of this distribution. NOTE: Please extend that file, not this notice.
 
45
#
 
46
# This program is free software; you can redistribute it and/or
 
47
# modify it under the terms of the GNU General Public License
 
48
# as published by the Free Software Foundation; either version 2
 
49
# of the License, or (at your option) any later version. For
 
50
# more details read LICENSE in the root of this distribution.
 
51
#
 
52
# This program is distributed in the hope that it will be useful,
 
53
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
54
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
55
#
 
56
# As per the GPL, removal of this notice is prohibited.