Aktualisierung
[kivitendo-erp.git] / SL / InstallationCheck.pm
1 package SL::InstallationCheck;
2
3 use vars qw(@required_modules);
4
5 @required_modules = (
6   { "name" => "Class::Accessor", "url" => "http://search.cpan.org/~kasei/" },
7   { "name" => "CGI", "url" => "http://search.cpan.org/~lds/" },
8   { "name" => "CGI::Ajax", "url" => "http://search.cpan.org/~bct/" },
9   { "name" => "DBI", "url" => "http://search.cpan.org/~timb/" },
10   { "name" => "DBD::Pg", "url" => "http://search.cpan.org/~dbdpg/" },
11   { "name" => "HTML::Template", "url" => "http://search.cpan.org/~samtregar/" },
12   { "name" => "Archive::Zip", "url" => "http://search.cpan.org/~adamk/" },
13   { "name" => "Text::Iconv", "url" => "http://search.cpan.org/~mpiotr/" },
14   { "name" => "Time::HiRes", "url" => "http://search.cpan.org/~jhi/" },
15   { "name" => "YAML", "url" => "http://search.cpan.org/~ingy/" },
16   );
17
18 sub module_available {
19   my ($module) = @_;
20
21   if (!defined(eval("require $module;"))) {
22     return 0;
23   } else {
24     return 1;
25   }
26 }
27
28 sub test_all_modules {
29   my @missing_modules;
30
31   map({ push(@missing_modules, $_) unless (module_available($_->{"name"})); }
32       @required_modules);
33
34   return @missing_modules;
35 }
36
37 1;