line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WE_Frontend::Info; |
2
|
|
|
|
|
|
|
|
3
|
7
|
|
|
7
|
|
4912
|
use strict; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
254
|
|
4
|
7
|
|
|
7
|
|
36
|
use vars qw($VERSION); |
|
7
|
|
|
|
|
33
|
|
|
7
|
|
|
|
|
598
|
|
5
|
|
|
|
|
|
|
$VERSION = sprintf("%d.%02d", q$Revision: 1.34 $ =~ /(\d+)\.(\d+)/); |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
###################################################################### |
8
|
|
|
|
|
|
|
package WEsiteinfo::Paths; |
9
|
7
|
|
|
7
|
|
50
|
use base qw(Class::Accessor); |
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
6627
|
|
10
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw(scheme servername serverport absoluteurl |
11
|
|
|
|
|
|
|
livescheme liveservername liveserverport |
12
|
|
|
|
|
|
|
liveabsoluteurl |
13
|
|
|
|
|
|
|
hosturl livehosturl |
14
|
|
|
|
|
|
|
uprootdir liveuprootdir |
15
|
|
|
|
|
|
|
rooturl rootdir cgiurl cgidir |
16
|
|
|
|
|
|
|
liverooturl liverootdir livecgiurl livecgidir |
17
|
|
|
|
|
|
|
we_templatebase site_we_templatebase |
18
|
|
|
|
|
|
|
site_templatebase we_htmldir we_htmlurl |
19
|
|
|
|
|
|
|
we_datadir photodir downloaddir |
20
|
|
|
|
|
|
|
pubhtmldir prototypedir |
21
|
|
|
|
|
|
|
htuser htpassword |
22
|
|
|
|
|
|
|
)); |
23
|
|
|
|
|
|
|
# backward compat: |
24
|
|
|
|
|
|
|
*we_htmlbase = \&we_htmldir; |
25
|
|
|
|
|
|
|
*we_database = \&we_datadir; |
26
|
|
|
|
|
|
|
|
27
|
2
|
|
|
2
|
|
21
|
sub new { bless {}, shift } # XXX this used to be __PACKAGE__ --- document! |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# Provide sensible defaults |
30
|
|
|
|
|
|
|
my %paths_constructed_member = |
31
|
|
|
|
|
|
|
(hosturl => sub { $_[0]->scheme . "://" . |
32
|
|
|
|
|
|
|
$_[0]->servername . |
33
|
|
|
|
|
|
|
(defined $_[0]->serverport && $_[0]->serverport ne "80" |
34
|
|
|
|
|
|
|
? ":" . $_[0]->serverport |
35
|
|
|
|
|
|
|
: "") |
36
|
|
|
|
|
|
|
}, |
37
|
|
|
|
|
|
|
livehosturl => sub { $_[0]->livescheme . "://" . |
38
|
|
|
|
|
|
|
$_[0]->liveservername . |
39
|
|
|
|
|
|
|
(defined $_[0]->liveserverport && $_[0]->liveserverport ne "80" |
40
|
|
|
|
|
|
|
? ":" . $_[0]->liveserverport |
41
|
|
|
|
|
|
|
: "") |
42
|
|
|
|
|
|
|
}, |
43
|
|
|
|
|
|
|
absoluteurl => sub { $_[0]->hosturl . $_[0]->rooturl }, |
44
|
|
|
|
|
|
|
liveabsoluteurl => sub { $_[0]->livehosturl . $_[0]->liverooturl }, |
45
|
|
|
|
|
|
|
rooturl => sub { "" }, |
46
|
|
|
|
|
|
|
rootdir => sub { $_[0]->uprootdir . "/htdocs" }, |
47
|
|
|
|
|
|
|
liverooturl => sub { "" }, |
48
|
|
|
|
|
|
|
liverootdir => sub { $_[0]->liveuprootdir . "/htdocs" }, |
49
|
|
|
|
|
|
|
cgiurl => sub { "/cgi-bin" }, |
50
|
|
|
|
|
|
|
cgidir => sub { $_[0]->uprootdir . "/cgi-bin" }, |
51
|
|
|
|
|
|
|
livecgiurl => sub { $_[0]->cgiurl }, |
52
|
|
|
|
|
|
|
livecgidir => sub { $_[0]->liveuprootdir . "/cgi-bin" }, |
53
|
|
|
|
|
|
|
we_htmldir => sub { $_[0]->rootdir . "/we" }, |
54
|
|
|
|
|
|
|
we_htmlurl => sub { $_[0]->rooturl . "/we" }, |
55
|
|
|
|
|
|
|
we_templatebase => sub { $_[0]->we_htmldir . "/we_templates" }, |
56
|
|
|
|
|
|
|
site_templatebase => sub { $_[0]->we_htmldir . "/" . |
57
|
|
|
|
|
|
|
$_[0]->{_parent}->project->name . |
58
|
|
|
|
|
|
|
"_templates" }, |
59
|
|
|
|
|
|
|
site_we_templatebase => sub { $_[0]->we_htmldir . "/" . |
60
|
|
|
|
|
|
|
$_[0]->{_parent}->project->name . |
61
|
|
|
|
|
|
|
"_we_templates" }, |
62
|
|
|
|
|
|
|
prototypedir => sub { $_[0]->we_htmldir . "/" . |
63
|
|
|
|
|
|
|
$_[0]->{_parent}->project->name . |
64
|
|
|
|
|
|
|
"_prototypes" }, |
65
|
|
|
|
|
|
|
photodir => sub { $_[0]->rootdir . "/photos" }, |
66
|
|
|
|
|
|
|
pubhtmldir => sub { $_[0]->rootdir }, |
67
|
|
|
|
|
|
|
we_datadir => sub { $_[0]->uprootdir . "/we_data" }, |
68
|
|
|
|
|
|
|
scheme => sub { "http" }, |
69
|
|
|
|
|
|
|
livescheme => sub { "http" }, |
70
|
|
|
|
|
|
|
); |
71
|
|
|
|
|
|
|
sub get { |
72
|
29
|
|
|
29
|
|
2786
|
my($self, $key) = @_; |
73
|
29
|
100
|
100
|
|
|
135
|
if (!defined $self->{$key} && exists $paths_constructed_member{$key}) { |
74
|
12
|
|
|
|
|
40
|
$paths_constructed_member{$key}->($self); |
75
|
|
|
|
|
|
|
} else { |
76
|
17
|
|
|
|
|
104
|
$self->SUPER::get($key); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
###################################################################### |
81
|
|
|
|
|
|
|
package WEsiteinfo::SearchEngine; |
82
|
7
|
|
|
7
|
|
9839
|
use base qw(Class::Accessor); |
|
7
|
|
|
|
|
21
|
|
|
7
|
|
|
|
|
1642
|
|
83
|
|
|
|
|
|
|
# prelive_htdigconf and live_htdigconf is obsolete |
84
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw(searchindexer htdigconf htdigconftemplate |
85
|
|
|
|
|
|
|
prelive_htdigconf live_htdigconf |
86
|
|
|
|
|
|
|
use_prelive_database)); |
87
|
0
|
|
|
0
|
|
0
|
sub new { bless {}, shift } |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
# Provide sensible defaults |
90
|
|
|
|
|
|
|
my %searchengine_constructed_member = |
91
|
|
|
|
|
|
|
(searchindexer => sub { "rundig" }, # XXX or htdig? |
92
|
|
|
|
|
|
|
); |
93
|
|
|
|
|
|
|
sub get { |
94
|
0
|
|
|
0
|
|
0
|
my($self, $key) = @_; |
95
|
0
|
0
|
0
|
|
|
0
|
if (!defined $self->{$key} && exists $searchengine_constructed_member{$key}) { |
96
|
0
|
|
|
|
|
0
|
$searchengine_constructed_member{$key}->($self); |
97
|
|
|
|
|
|
|
} else { |
98
|
0
|
|
|
|
|
0
|
$self->SUPER::get($key); |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
###################################################################### |
103
|
|
|
|
|
|
|
package WEsiteinfo::Staging; |
104
|
7
|
|
|
7
|
|
50
|
use base qw(Class::Accessor); |
|
7
|
|
|
|
|
11
|
|
|
7
|
|
|
|
|
2194
|
|
105
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw(transport user password host directory |
106
|
|
|
|
|
|
|
cgidirectory tempdirectory temp2directory |
107
|
|
|
|
|
|
|
stagingext rsakey archivefile message)); |
108
|
0
|
|
|
0
|
|
0
|
sub new { bless {}, shift } |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
# Provide sensible defaults |
111
|
|
|
|
|
|
|
my %staging_constructed_member = |
112
|
|
|
|
|
|
|
(directory => sub { $_[0]->{_parent}->paths->liverootdir }, |
113
|
|
|
|
|
|
|
cgidirectory => sub { warn $_[0]->{_parent}->paths->livecgidir; $_[0]->{_parent}->paths->livecgidir }, |
114
|
|
|
|
|
|
|
); |
115
|
|
|
|
|
|
|
sub get { |
116
|
19
|
|
|
19
|
|
7918
|
my($self, $key) = @_; |
117
|
19
|
50
|
66
|
|
|
118
|
if (!defined $self->{$key} && exists $staging_constructed_member{$key}) { |
118
|
0
|
|
|
|
|
0
|
$staging_constructed_member{$key}->($self); |
119
|
|
|
|
|
|
|
} else { |
120
|
19
|
|
|
|
|
76
|
$self->SUPER::get($key); |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
###################################################################### |
125
|
|
|
|
|
|
|
package WEsiteinfo::Siteext; |
126
|
7
|
|
|
7
|
|
45
|
use base qw(Class::Accessor); |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
883
|
|
127
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw(external_auth notify_mailer notify_background)); |
128
|
0
|
|
|
0
|
|
0
|
sub new { bless {}, shift } |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
###################################################################### |
131
|
|
|
|
|
|
|
package WEprojectinfo; |
132
|
7
|
|
|
7
|
|
35
|
use base qw(Class::Accessor); |
|
7
|
|
|
|
|
15
|
|
|
7
|
|
|
|
|
3560
|
|
133
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw(name longname |
134
|
|
|
|
|
|
|
sitelanguages editorlanguages pagetypes |
135
|
|
|
|
|
|
|
defaulteditorlang cookieexpirationtime |
136
|
|
|
|
|
|
|
productname templatefortype labelfortype |
137
|
|
|
|
|
|
|
imagetypes imagesubtypes |
138
|
|
|
|
|
|
|
iconfortype features projectext |
139
|
|
|
|
|
|
|
class feclass |
140
|
|
|
|
|
|
|
stagingexcept stagingexceptpat stagingextracgi |
141
|
|
|
|
|
|
|
stagingadditional |
142
|
|
|
|
|
|
|
adminmail developermail |
143
|
|
|
|
|
|
|
sessionlocking useversioning |
144
|
|
|
|
|
|
|
standardext |
145
|
|
|
|
|
|
|
)); |
146
|
1
|
|
|
1
|
|
11
|
sub new { bless {}, shift } |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
# Provide sensible defaults |
149
|
|
|
|
|
|
|
my %projectinfo_constructed_member = |
150
|
|
|
|
|
|
|
(productname => sub { "web.editor" }, |
151
|
|
|
|
|
|
|
editorlanguages => sub { [qw(de en)] }, |
152
|
|
|
|
|
|
|
defaulteditorlang => sub { $_[0]->editorlanguages->[0] }, |
153
|
|
|
|
|
|
|
cookieexpirationtime => sub { '+1d' }, |
154
|
|
|
|
|
|
|
developermail => sub { 'eserte@users.sourceforge.net' }, |
155
|
|
|
|
|
|
|
standardext => sub { ".html" } |
156
|
|
|
|
|
|
|
); |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
sub get { |
159
|
16
|
|
|
16
|
|
710
|
my($self, $key) = @_; |
160
|
16
|
50
|
66
|
|
|
399
|
if (!defined $self->{$key} && exists $projectinfo_constructed_member{$key}) { |
|
|
100
|
100
|
|
|
|
|
|
|
50
|
33
|
|
|
|
|
|
|
50
|
|
|
|
|
|
161
|
0
|
|
|
|
|
0
|
$projectinfo_constructed_member{$key}->($self); |
162
|
|
|
|
|
|
|
} elsif ($key eq 'features' && !exists $self->{features}) { |
163
|
1
|
|
|
|
|
6
|
return {}; |
164
|
|
|
|
|
|
|
} elsif ($key eq 'longname' && !exists $self->{longname}) { |
165
|
0
|
|
|
|
|
0
|
return $self->{name}; |
166
|
|
|
|
|
|
|
} elsif ($key =~ /^(?:sessionlocking|useversioning)$/) { |
167
|
0
|
|
|
|
|
0
|
return $self->get("features")->{$key}; |
168
|
|
|
|
|
|
|
} else { |
169
|
15
|
|
|
|
|
71
|
$self->SUPER::get($key); |
170
|
|
|
|
|
|
|
} |
171
|
|
|
|
|
|
|
} |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
sub set { |
174
|
5
|
|
|
5
|
|
1054
|
my($self, $key, $val) = @_; |
175
|
5
|
50
|
|
|
|
50
|
if ($key =~ /^(?:sessionlocking|useversioning)$/) { |
176
|
0
|
|
|
|
|
0
|
return $self->{features}{$key} = $val; |
177
|
|
|
|
|
|
|
} else { |
178
|
5
|
|
|
|
|
39
|
$self->SUPER::set($key, $val); |
179
|
|
|
|
|
|
|
} |
180
|
|
|
|
|
|
|
} |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
###################################################################### |
183
|
|
|
|
|
|
|
package WEsiteinfo; |
184
|
7
|
|
|
7
|
|
40
|
use base qw(Exporter Class::Accessor); |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
1812
|
|
185
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw(project paths searchengine staging debug siteext |
186
|
|
|
|
|
|
|
liveconfig preliveconfig)); |
187
|
1
|
|
|
1
|
|
202
|
sub new { bless {}, shift } |
188
|
|
|
|
|
|
|
@WEsiteinfo::EXPORT_OK = qw($c); |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
my %subobject = qw(project 1 paths 1 searchengine 1 staging 1 siteext 1); |
191
|
|
|
|
|
|
|
sub set { |
192
|
10
|
|
|
10
|
|
421
|
my($self, $key, $val) = @_; |
193
|
10
|
50
|
33
|
|
|
80
|
if (exists $subobject{$key} && UNIVERSAL::isa($val, 'HASH')) { |
194
|
|
|
|
|
|
|
# provide "backlink" to parent object |
195
|
10
|
|
|
|
|
19
|
$val->{_parent} = $self; |
196
|
|
|
|
|
|
|
} |
197
|
10
|
|
|
|
|
77
|
$self->SUPER::set($key, $val); |
198
|
|
|
|
|
|
|
} |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
1; |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
__END__ |