line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::Install::RTx; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
487
|
use 5.008; |
|
1
|
|
|
|
|
3
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
20
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
24
|
|
6
|
1
|
|
|
1
|
|
5
|
no warnings 'once'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
450
|
use Module::Install::Base; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
9
|
1
|
|
|
1
|
|
6
|
use base 'Module::Install::Base'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
105
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.41'; |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
554
|
use FindBin; |
|
1
|
|
|
|
|
995
|
|
|
1
|
|
|
|
|
44
|
|
13
|
1
|
|
|
1
|
|
6
|
use File::Glob (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
14
|
|
14
|
1
|
|
|
1
|
|
5
|
use File::Basename (); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
2251
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my @DIRS = qw(etc lib html static bin sbin po var); |
17
|
|
|
|
|
|
|
my @INDEX_DIRS = qw(lib bin sbin); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub RTx { |
20
|
0
|
|
|
0
|
1
|
|
my ( $self, $name, $extra_args ) = @_; |
21
|
0
|
|
0
|
|
|
|
$extra_args ||= {}; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# Set up names |
24
|
0
|
|
|
|
|
|
my $fname = $name; |
25
|
0
|
|
|
|
|
|
$fname =~ s!-!/!g; |
26
|
|
|
|
|
|
|
|
27
|
0
|
0
|
|
|
|
|
$self->name( $name ) |
28
|
|
|
|
|
|
|
unless $self->name; |
29
|
0
|
0
|
|
|
|
|
$self->all_from( "lib/$fname.pm" ) |
30
|
|
|
|
|
|
|
unless $self->version; |
31
|
0
|
0
|
|
|
|
|
$self->abstract("$name Extension") |
32
|
|
|
|
|
|
|
unless $self->abstract; |
33
|
0
|
0
|
|
|
|
|
unless ( $extra_args->{no_readme_generation} ) { |
34
|
0
|
|
|
|
|
|
$self->readme_from( "lib/$fname.pm", |
35
|
|
|
|
|
|
|
{ options => [ quotes => "none" ] } ); |
36
|
|
|
|
|
|
|
} |
37
|
0
|
|
|
|
|
|
$self->add_metadata("x_module_install_rtx_version", $VERSION ); |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
my $installdirs = $ENV{INSTALLDIRS}; |
40
|
0
|
|
|
|
|
|
for ( @ARGV ) { |
41
|
0
|
0
|
|
|
|
|
if ( /INSTALLDIRS=(.*)/ ) { |
42
|
0
|
|
|
|
|
|
$installdirs = $1; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# Try to find RT.pm |
47
|
0
|
|
|
|
|
|
my @prefixes = qw( /opt /usr/local /home /usr /sw /usr/share/request-tracker4); |
48
|
0
|
0
|
|
|
|
|
$ENV{RTHOME} =~ s{/RT\.pm$}{} if defined $ENV{RTHOME}; |
49
|
0
|
0
|
|
|
|
|
$ENV{RTHOME} =~ s{/lib/?$}{} if defined $ENV{RTHOME}; |
50
|
0
|
0
|
|
|
|
|
my @try = $ENV{RTHOME} ? ($ENV{RTHOME}, "$ENV{RTHOME}/lib") : (); |
51
|
0
|
|
|
|
|
|
while (1) { |
52
|
0
|
|
|
|
|
|
my @look = @INC; |
53
|
0
|
0
|
|
|
|
|
unshift @look, grep {defined and -d $_} @try; |
|
0
|
|
|
|
|
|
|
54
|
0
|
0
|
|
|
|
|
push @look, grep {defined and -d $_} |
55
|
0
|
|
|
|
|
|
map { ( "$_/rt5/lib", "$_/lib/rt5", "$_/rt4/lib", "$_/lib/rt4", "$_/lib" ) } @prefixes; |
|
0
|
|
|
|
|
|
|
56
|
0
|
0
|
|
|
|
|
last if eval {local @INC = @look; require RT; $RT::LocalLibPath}; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
warn |
59
|
|
|
|
|
|
|
"Cannot find the location of RT.pm that defines \$RT::LocalPath in: @look\n"; |
60
|
0
|
0
|
|
|
|
|
my $given = $self->prompt("Path to directory containing your RT.pm:") or exit; |
61
|
0
|
|
|
|
|
|
$given =~ s{/RT\.pm$}{}; |
62
|
0
|
|
|
|
|
|
$given =~ s{/lib/?$}{}; |
63
|
0
|
|
|
|
|
|
@try = ($given, "$given/lib"); |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
|
print "Using RT configuration from $INC{'RT.pm'}:\n"; |
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
|
my $local_lib_path = $RT::LocalLibPath; |
69
|
0
|
|
|
|
|
|
unshift @INC, $local_lib_path; |
70
|
0
|
|
|
|
|
|
my $lib_path = File::Basename::dirname( $INC{'RT.pm'} ); |
71
|
0
|
|
|
|
|
|
unshift @INC, $lib_path; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
# Set a baseline minimum version |
74
|
0
|
0
|
|
|
|
|
unless ( $extra_args->{deprecated_rt} ) { |
75
|
0
|
|
|
|
|
|
$self->requires_rt('4.0.0'); |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
# Installation locations |
79
|
0
|
|
|
|
|
|
my %path; |
80
|
|
|
|
|
|
|
my $plugin_path; |
81
|
0
|
0
|
0
|
|
|
|
if ( $installdirs && $installdirs eq 'vendor' ) { |
82
|
0
|
|
|
|
|
|
$plugin_path = $RT::PluginPath; |
83
|
|
|
|
|
|
|
} else { |
84
|
0
|
|
|
|
|
|
$plugin_path = $RT::LocalPluginPath; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
$path{$_} = $plugin_path . "/$name/$_" |
87
|
0
|
|
|
|
|
|
foreach @DIRS; |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
# Copy RT 4.2.0 static files into NoAuth; insufficient for |
90
|
|
|
|
|
|
|
# images, but good enough for css and js. |
91
|
0
|
0
|
|
|
|
|
$path{static} = "$path{html}/NoAuth/" |
92
|
|
|
|
|
|
|
unless $RT::StaticPath; |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
# Delete the ones we don't need |
95
|
0
|
|
|
|
|
|
delete $path{$_} for grep {not -d "$FindBin::Bin/$_"} keys %path; |
|
0
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
|
97
|
0
|
|
|
|
|
|
my %index = map { $_ => 1 } @INDEX_DIRS; |
|
0
|
|
|
|
|
|
|
98
|
0
|
|
|
|
|
|
$self->no_index( directory => $_ ) foreach grep !$index{$_}, @DIRS; |
99
|
|
|
|
|
|
|
|
100
|
0
|
|
|
|
|
|
my $args = join ', ', map "q($_)", map { ($_, "\$(DESTDIR)$path{$_}") } |
|
0
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
sort keys %path; |
102
|
|
|
|
|
|
|
|
103
|
0
|
|
|
|
|
|
printf "%-10s => %s\n", $_, $path{$_} for sort keys %path; |
104
|
|
|
|
|
|
|
|
105
|
0
|
0
|
|
|
|
|
if ( my @dirs = map { ( -D => $_ ) } grep $path{$_}, qw(bin html sbin etc) ) { |
|
0
|
|
|
|
|
|
|
106
|
0
|
|
|
|
|
|
my @po = map { ( -o => $_ ) } |
|
0
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
grep -f, |
108
|
|
|
|
|
|
|
File::Glob::bsd_glob("po/*.po"); |
109
|
0
|
0
|
|
|
|
|
$self->postamble(<< ".") if @po; |
110
|
|
|
|
|
|
|
lexicons :: |
111
|
|
|
|
|
|
|
\t\$(NOECHO) \$(PERL) -MLocale::Maketext::Extract::Run=xgettext -e \"xgettext(qw(@dirs @po))\" |
112
|
|
|
|
|
|
|
. |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
0
|
|
|
|
|
|
my $remove_files; |
116
|
0
|
0
|
|
|
|
|
if( $extra_args->{'remove_files'} ){ |
117
|
0
|
|
|
|
|
|
$self->include('Module::Install::RTx::Remove'); |
118
|
0
|
|
|
|
|
|
our @remove_files; |
119
|
0
|
0
|
|
|
|
|
eval { require "etc/upgrade/remove_files" } |
|
0
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
or print "No remove file located, no files to remove\n"; |
121
|
0
|
|
|
|
|
|
$remove_files = join ",", map {"q(\$(DESTDIR)$plugin_path/$name/$_)"} @remove_files; |
|
0
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
0
|
0
|
|
|
|
|
$self->include('Module::Install::RTx::Runtime') if $self->admin; |
125
|
0
|
0
|
|
|
|
|
$self->include_deps( 'YAML::Tiny', 0 ) if $self->admin; |
126
|
0
|
|
|
|
|
|
my $postamble = << "."; |
127
|
|
|
|
|
|
|
install :: |
128
|
|
|
|
|
|
|
\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Iinc -MModule::Install::RTx::Runtime -e"RTxPlugin()" |
129
|
|
|
|
|
|
|
. |
130
|
|
|
|
|
|
|
|
131
|
0
|
0
|
|
|
|
|
if( $remove_files ){ |
132
|
0
|
|
|
|
|
|
$postamble .= << "."; |
133
|
|
|
|
|
|
|
\t\$(NOECHO) \$(PERL) -MModule::Install::RTx::Remove -e \"RTxRemove([$remove_files])\" |
134
|
|
|
|
|
|
|
. |
135
|
|
|
|
|
|
|
} |
136
|
|
|
|
|
|
|
|
137
|
0
|
|
|
|
|
|
$postamble .= << "."; |
138
|
|
|
|
|
|
|
\t\$(NOECHO) \$(PERL) -MExtUtils::Install -e \"install({$args})\" |
139
|
|
|
|
|
|
|
. |
140
|
|
|
|
|
|
|
|
141
|
0
|
0
|
0
|
|
|
|
if ( $path{var} and -d $RT::MasonDataDir ) { |
142
|
0
|
|
|
|
|
|
my ( $uid, $gid ) = ( stat($RT::MasonDataDir) )[ 4, 5 ]; |
143
|
0
|
|
|
|
|
|
$postamble .= << "."; |
144
|
|
|
|
|
|
|
\t\$(NOECHO) chown -R $uid:$gid $path{var} |
145
|
|
|
|
|
|
|
. |
146
|
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
|
148
|
0
|
|
|
|
|
|
my %has_etc; |
149
|
0
|
0
|
|
|
|
|
if ( File::Glob::bsd_glob("$FindBin::Bin/etc/schema.*") ) { |
150
|
0
|
|
|
|
|
|
$has_etc{schema}++; |
151
|
|
|
|
|
|
|
} |
152
|
0
|
0
|
|
|
|
|
if ( File::Glob::bsd_glob("$FindBin::Bin/etc/acl.*") ) { |
153
|
0
|
|
|
|
|
|
$has_etc{acl}++; |
154
|
|
|
|
|
|
|
} |
155
|
0
|
0
|
|
|
|
|
if ( -e 'etc/initialdata' ) { $has_etc{initialdata}++; } |
|
0
|
|
|
|
|
|
|
156
|
0
|
0
|
|
|
|
|
if ( grep { /\d+\.\d+\.\d+.*$/ } glob('etc/upgrade/*.*.*') ) { |
|
0
|
|
|
|
|
|
|
157
|
0
|
|
|
|
|
|
$has_etc{upgrade}++; |
158
|
|
|
|
|
|
|
} |
159
|
|
|
|
|
|
|
|
160
|
0
|
|
|
|
|
|
$self->postamble("$postamble\n"); |
161
|
0
|
0
|
|
|
|
|
if ( $path{lib} ) { |
162
|
0
|
|
|
|
|
|
$self->makemaker_args( INSTALLSITELIB => $path{'lib'} ); |
163
|
0
|
|
|
|
|
|
$self->makemaker_args( INSTALLARCHLIB => $path{'lib'} ); |
164
|
0
|
|
|
|
|
|
$self->makemaker_args( INSTALLVENDORLIB => $path{'lib'} ) |
165
|
|
|
|
|
|
|
} else { |
166
|
0
|
|
|
|
|
|
$self->makemaker_args( PM => { "" => "" }, ); |
167
|
|
|
|
|
|
|
} |
168
|
|
|
|
|
|
|
|
169
|
0
|
|
|
|
|
|
$self->makemaker_args( INSTALLSITEMAN1DIR => "$RT::LocalPath/man/man1" ); |
170
|
0
|
|
|
|
|
|
$self->makemaker_args( INSTALLSITEMAN3DIR => "$RT::LocalPath/man/man3" ); |
171
|
0
|
|
|
|
|
|
$self->makemaker_args( INSTALLSITEARCH => "$RT::LocalPath/man" ); |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
# INSTALLDIRS=vendor should install manpages into /usr/share/man. |
174
|
|
|
|
|
|
|
# That is the default path in most distributions. Need input from |
175
|
|
|
|
|
|
|
# Redhat, Centos etc. |
176
|
0
|
|
|
|
|
|
$self->makemaker_args( INSTALLVENDORMAN1DIR => "/usr/share/man/man1" ); |
177
|
0
|
|
|
|
|
|
$self->makemaker_args( INSTALLVENDORMAN3DIR => "/usr/share/man/man3" ); |
178
|
0
|
|
|
|
|
|
$self->makemaker_args( INSTALLVENDORARCH => "/usr/share/man" ); |
179
|
|
|
|
|
|
|
|
180
|
0
|
0
|
|
|
|
|
if (%has_etc) { |
181
|
0
|
|
|
|
|
|
print "For first-time installation, type 'make initdb'.\n"; |
182
|
0
|
|
|
|
|
|
my $initdb = ''; |
183
|
0
|
0
|
|
|
|
|
$initdb .= <<"." if $has_etc{schema}; |
184
|
|
|
|
|
|
|
\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Iinc -MModule::Install::RTx::Runtime -e"RTxDatabase(qw(schema \$(NAME) \$(VERSION)))" |
185
|
|
|
|
|
|
|
. |
186
|
0
|
0
|
|
|
|
|
$initdb .= <<"." if $has_etc{acl}; |
187
|
|
|
|
|
|
|
\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Iinc -MModule::Install::RTx::Runtime -e"RTxDatabase(qw(acl \$(NAME) \$(VERSION)))" |
188
|
|
|
|
|
|
|
. |
189
|
0
|
0
|
|
|
|
|
$initdb .= <<"." if $has_etc{initialdata}; |
190
|
|
|
|
|
|
|
\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Iinc -MModule::Install::RTx::Runtime -e"RTxDatabase(qw(insert \$(NAME) \$(VERSION)))" |
191
|
|
|
|
|
|
|
. |
192
|
0
|
|
|
|
|
|
$self->postamble("initdb ::\n$initdb\n"); |
193
|
0
|
|
|
|
|
|
$self->postamble("initialize-database ::\n$initdb\n"); |
194
|
0
|
0
|
|
|
|
|
if ($has_etc{upgrade}) { |
195
|
0
|
|
|
|
|
|
print "To upgrade from a previous version of this extension, use 'make upgrade-database'\n"; |
196
|
0
|
|
|
|
|
|
my $upgradedb = qq|\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Iinc -MModule::Install::RTx::Runtime -e"RTxDatabase(qw(upgrade \$(NAME) \$(VERSION)))"\n|; |
197
|
0
|
|
|
|
|
|
$self->postamble("upgrade-database ::\n$upgradedb\n"); |
198
|
0
|
|
|
|
|
|
$self->postamble("upgradedb ::\n$upgradedb\n"); |
199
|
|
|
|
|
|
|
} |
200
|
|
|
|
|
|
|
} |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
} |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
sub requires_rt { |
205
|
0
|
|
|
0
|
1
|
|
my ($self,$version) = @_; |
206
|
|
|
|
|
|
|
|
207
|
0
|
|
|
|
|
|
_load_rt_handle(); |
208
|
|
|
|
|
|
|
|
209
|
0
|
0
|
|
|
|
|
if ($self->is_admin) { |
210
|
0
|
|
|
|
|
|
$self->add_metadata("x_requires_rt", $version); |
211
|
0
|
|
|
|
|
|
my @sorted = sort RT::Handle::cmp_version $version,'4.0.0'; |
212
|
0
|
0
|
0
|
|
|
|
$self->perl_version('5.008003') if $sorted[0] eq '4.0.0' |
|
|
|
0
|
|
|
|
|
213
|
|
|
|
|
|
|
and (not $self->perl_version or '5.008003' > $self->perl_version); |
214
|
0
|
|
|
|
|
|
@sorted = sort RT::Handle::cmp_version $version,'4.2.0'; |
215
|
0
|
0
|
0
|
|
|
|
$self->perl_version('5.010001') if $sorted[0] eq '4.2.0' |
|
|
|
0
|
|
|
|
|
216
|
|
|
|
|
|
|
and (not $self->perl_version or '5.010001' > $self->perl_version); |
217
|
|
|
|
|
|
|
} |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
# if we're exactly the same version as what we want, silently return |
220
|
0
|
0
|
|
|
|
|
return if ($version eq $RT::VERSION); |
221
|
|
|
|
|
|
|
|
222
|
0
|
|
|
|
|
|
my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION; |
223
|
|
|
|
|
|
|
|
224
|
0
|
0
|
|
|
|
|
if ($sorted[-1] eq $version) { |
225
|
0
|
|
|
|
|
|
die <<"EOT"; |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
**** Error: This extension requires RT $version. Your installed version |
228
|
|
|
|
|
|
|
of RT ($RT::VERSION) is too old. |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
EOT |
231
|
|
|
|
|
|
|
} |
232
|
|
|
|
|
|
|
} |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
sub requires_rt_plugin { |
235
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
236
|
0
|
|
|
|
|
|
my ( $plugin ) = @_; |
237
|
|
|
|
|
|
|
|
238
|
0
|
0
|
|
|
|
|
if ($self->is_admin) { |
239
|
0
|
|
0
|
|
|
|
my $plugins = $self->Meta->{values}{"x_requires_rt_plugins"} || []; |
240
|
0
|
|
|
|
|
|
push @{$plugins}, $plugin; |
|
0
|
|
|
|
|
|
|
241
|
0
|
|
|
|
|
|
$self->add_metadata("x_requires_rt_plugins", $plugins); |
242
|
|
|
|
|
|
|
} |
243
|
|
|
|
|
|
|
|
244
|
0
|
|
|
|
|
|
my $path = $plugin; |
245
|
0
|
|
|
|
|
|
$path =~ s{\:\:}{-}g; |
246
|
0
|
|
|
|
|
|
$path = "$RT::LocalPluginPath/$path/lib"; |
247
|
0
|
0
|
|
|
|
|
if ( -e $path ) { |
248
|
0
|
|
|
|
|
|
unshift @INC, $path; |
249
|
|
|
|
|
|
|
} else { |
250
|
0
|
|
|
|
|
|
my $name = $self->name; |
251
|
0
|
|
|
|
|
|
warn <<"EOT"; |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
**** Warning: $name requires that the $plugin plugin be installed and |
254
|
|
|
|
|
|
|
enabled; it does not appear to be installed. |
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
EOT |
257
|
|
|
|
|
|
|
} |
258
|
0
|
|
|
|
|
|
$self->requires(@_); |
259
|
|
|
|
|
|
|
} |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
sub rt_too_new { |
262
|
0
|
|
|
0
|
1
|
|
my ($self,$version,$msg) = @_; |
263
|
0
|
|
|
|
|
|
my $name = $self->name; |
264
|
0
|
|
0
|
|
|
|
$msg ||= <
|
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
**** Error: Your installed version of RT (%s) is too new; this extension |
267
|
|
|
|
|
|
|
only works with versions older than %s. |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
EOT |
270
|
0
|
0
|
|
|
|
|
$self->add_metadata("x_rt_too_new", $version) if $self->is_admin; |
271
|
|
|
|
|
|
|
|
272
|
0
|
|
|
|
|
|
_load_rt_handle(); |
273
|
0
|
|
|
|
|
|
my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION; |
274
|
|
|
|
|
|
|
|
275
|
0
|
0
|
|
|
|
|
if ($sorted[0] eq $version) { |
276
|
0
|
|
|
|
|
|
die sprintf($msg,$RT::VERSION,$version); |
277
|
|
|
|
|
|
|
} |
278
|
|
|
|
|
|
|
} |
279
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
# RT::Handle runs FinalizeDatabaseType which calls RT->Config->Get |
281
|
|
|
|
|
|
|
# On 3.8, this dies. On 4.0/4.2 ->Config transparently runs LoadConfig. |
282
|
|
|
|
|
|
|
# LoadConfig requires being able to read RT_SiteConfig.pm (root) so we'd |
283
|
|
|
|
|
|
|
# like to avoid pushing that on users. |
284
|
|
|
|
|
|
|
# Fake up just enough Config to let FinalizeDatabaseType finish, and |
285
|
|
|
|
|
|
|
# anyone later calling LoadConfig will overwrite our shenanigans. |
286
|
|
|
|
|
|
|
sub _load_rt_handle { |
287
|
0
|
0
|
|
0
|
|
|
unless ($RT::Config) { |
288
|
0
|
|
|
|
|
|
require RT::Config; |
289
|
0
|
|
|
|
|
|
$RT::Config = RT::Config->new; |
290
|
0
|
|
|
|
|
|
RT->Config->Set('DatabaseType','mysql'); |
291
|
|
|
|
|
|
|
} |
292
|
0
|
|
|
|
|
|
require RT::Handle; |
293
|
|
|
|
|
|
|
} |
294
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
1; |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
__END__ |