Lines 4-19
use strict;
Link Here
|
4 |
use warnings; |
4 |
use warnings; |
5 |
use diagnostics; |
5 |
use diagnostics; |
6 |
|
6 |
|
7 |
# use Install; |
|
|
8 |
use InstallAuth; |
7 |
use InstallAuth; |
|
|
8 |
use CGI; |
9 |
use IPC::Cmd; |
10 |
|
9 |
use C4::Context; |
11 |
use C4::Context; |
10 |
use C4::Output; |
12 |
use C4::Output; |
11 |
use C4::Languages qw(getAllLanguages getTranslatedLanguages); |
13 |
use C4::Languages qw(getAllLanguages getTranslatedLanguages); |
12 |
use C4::Installer; |
14 |
use C4::Installer; |
13 |
|
15 |
|
14 |
use CGI; |
|
|
15 |
use IPC::Cmd; |
16 |
|
17 |
my $query = new CGI; |
16 |
my $query = new CGI; |
18 |
my $step = $query->param('step'); |
17 |
my $step = $query->param('step'); |
19 |
|
18 |
|
Lines 57-182
if ( $step && $step == 1 ) {
Link Here
|
57 |
#Checking ALL perl Modules and services needed are installed. |
56 |
#Checking ALL perl Modules and services needed are installed. |
58 |
#Whenever there is an error, adding a report to the page |
57 |
#Whenever there is an error, adding a report to the page |
59 |
$template->param( language => 1 ); |
58 |
$template->param( language => 1 ); |
60 |
my $problem; |
59 |
$template->param( 'checkmodule' => 1 ); # we start with the assumption that there are no problems and set this to 0 if there are |
61 |
|
60 |
|
62 |
unless ( $] >= 5.006001 ) { # Bug 179 |
61 |
unless ( $] >= 5.006001 ) { # Bug 179 |
63 |
$template->param( "problems" => 1, "perlversion" => 1 ); |
62 |
$template->param( problems => 1, perlversion => 1, checkmodule => 0 ); |
64 |
$problem = 1; |
|
|
65 |
} |
66 |
|
67 |
# We could here use a special find |
68 |
my @missing = (); |
69 |
unless ( eval { require ZOOM } ) { |
70 |
push @missing, { name => "ZOOM" }; |
71 |
} |
72 |
unless ( eval { require YAML::Syck } ) { |
73 |
push @missing, { name => "YAML::Syck" }; |
74 |
} |
75 |
unless ( eval { require LWP::Simple } ) { |
76 |
push @missing, { name => "LWP::Simple" }; |
77 |
} |
78 |
unless ( eval { require XML::Simple } ) { |
79 |
push @missing, { name => "XML::Simple" }; |
80 |
} |
81 |
unless ( eval { require MARC::File::XML } ) { |
82 |
push @missing, { name => "MARC::File::XML" }; |
83 |
} |
84 |
unless ( eval { require MARC::File::USMARC } ) { |
85 |
push @missing, { name => "MARC::File::USMARC" }; |
86 |
} |
87 |
unless ( eval { require DBI } ) { |
88 |
push @missing, { name => "DBI" }; |
89 |
} |
90 |
unless ( eval { require Date::Manip } ) { |
91 |
push @missing, { name => "Date::Manip" }; |
92 |
} |
93 |
unless ( eval { require DBD::mysql } ) { |
94 |
push @missing, { name => "DBD::mysql" }; |
95 |
} |
96 |
unless ( eval { require HTML::Template::Pro } ) { |
97 |
push @missing, { name => "HTML::Template::Pro" }; |
98 |
} |
99 |
unless ( eval { require Date::Calc } ) { |
100 |
push @missing, { name => "Date::Calc" }; |
101 |
} |
102 |
unless ( eval { require Digest::MD5 } ) { |
103 |
push @missing, { name => "Digest::MD5" }; |
104 |
} |
105 |
unless ( eval { require MARC::Record } ) { |
106 |
push @missing, { name => "MARC::Record" }; |
107 |
} |
108 |
unless ( eval { require Mail::Sendmail } ) { |
109 |
push @missing, { name => "Mail::Sendmail", usagemail => 1 }; |
110 |
} |
111 |
unless ( eval { require List::MoreUtils } ) { |
112 |
push @missing, { name => "List::MoreUtils" }; |
113 |
} |
114 |
unless ( eval { require XML::RSS } ) { |
115 |
push @missing, { name => "XML::RSS" }; |
116 |
} |
117 |
unless ( eval { require CGI::Carp } ) { |
118 |
push @missing, { name => "CGI::Carp" }; |
119 |
} |
63 |
} |
120 |
|
64 |
|
|
|
65 |
my $perl_modules = C4::Installer::PerlModules->new; |
66 |
$perl_modules->version_info; |
121 |
|
67 |
|
122 |
# The following modules are not mandatory, depends on how the library want to use Koha |
68 |
my $modules = $perl_modules->get_attr('missing_pm'); |
123 |
unless ( eval { require PDF::API2 } ) { |
69 |
if (scalar(@$modules)) { |
124 |
if ( $#missing >= 0 ) { # only when $#missing >= 0 so this isn't fatal |
70 |
my @components = (); |
125 |
push @missing, { name => "PDF::API2", usagebarcode => 1 }; |
71 |
my $checkmodule = 1; |
126 |
} |
72 |
foreach (@$modules) { |
127 |
} |
73 |
my ($module, $stats) = each %$_; |
128 |
unless ( eval { require GD::Barcorde } ) { |
74 |
$checkmodule = 0 if $stats->{'required'}; |
129 |
if ( $#missing >= 0 ) { # only when $#missing >= 0 so this isn't fatal |
75 |
push( |
130 |
push @missing, |
76 |
@components, |
131 |
{ name => "GD::Barcode", usagebarcode => 1, usagespine => 1 }; |
77 |
{ |
132 |
} |
78 |
name => $module, |
133 |
} |
79 |
version => $stats->{'min_ver'}, |
134 |
unless ( eval { require GD } ) { |
80 |
require => $stats->{'required'}, |
135 |
if ( $#missing >= 0 ) { # only when $#missing >= 0 so this isn't fatal |
81 |
usage => $stats->{'usage'}, |
136 |
push @missing, |
82 |
} |
137 |
{ name => "GD", usagepatronimages => 1 }; |
83 |
); |
138 |
} |
|
|
139 |
} |
140 |
unless ( eval { require Graphics::Magick } ) { |
141 |
if ( $#missing >= 0 ) { # only when $#missing >= 0 so this isn't fatal |
142 |
push @missing, |
143 |
{ name => "Graphics::Magick", usagepatroncards => 1 }; |
144 |
} |
145 |
} |
146 |
unless ( eval { require Data::Random } ) { |
147 |
if ( $#missing >= 0 ) { # only when $#missing >= 0 so this isn't fatal |
148 |
push @missing, { name => "Data::Random", usagebarcode => 1 }; |
149 |
} |
150 |
} |
151 |
unless ( eval { require PDF::Reuse::Barcode } ) { |
152 |
if ( $#missing >= 0 ) { # only when $#missing >= 0 so this isn't fatal |
153 |
push @missing, { name => "PDF::Reuse::Barcode", usagebarcode => 1 }; |
154 |
} |
155 |
} |
156 |
unless ( eval { require PDF::Report } ) { |
157 |
if ( $#missing >= 0 ) { # only when $#missing >= 0 so this isn't fatal |
158 |
push @missing, { name => "PDF::Report", usagebarcode => 1 }; |
159 |
} |
160 |
} |
161 |
unless ( eval { require Algorithm::CheckDigits } ) { |
162 |
if ( $#missing >= 0 ) { # only when $#missing >= 0 so this isn't fatal |
163 |
push @missing, { name => "Algorithm::CheckDigits", usagebarcode => 1 }; |
164 |
} |
165 |
} |
166 |
unless ( eval { require GD::Barcode::UPCE } ) { |
167 |
if ( $#missing >= 0 ) { # only when $#missing >= 0 so this isn't fatal |
168 |
push @missing, { name => "GD::Barcode::UPCE", usagepine => 1 }; |
169 |
} |
170 |
} |
171 |
unless ( eval { require Net::LDAP } ) { |
172 |
if ( $#missing >= 0 ) { # only when $#missing >= 0 so this isn't fatal |
173 |
push @missing, { name => "Net::LDAP", usageLDAP => 1 }; |
174 |
} |
84 |
} |
|
|
85 |
@components = sort {$a->{'name'} cmp $b->{'name'}} @components; |
86 |
$template->param( missing_modules => \@components, checkmodule => $checkmodule ); |
175 |
} |
87 |
} |
176 |
$template->param( missings => \@missing ) if ( scalar(@missing) > 0 ); |
|
|
177 |
$template->param( 'checkmodule' => 1 ) |
178 |
unless ( scalar(@missing) && $problem ); |
179 |
|
180 |
} |
88 |
} |
181 |
elsif ( $step && $step == 2 ) { |
89 |
elsif ( $step && $step == 2 ) { |
182 |
# |
90 |
# |