3977bb4697720333502cac47239a29b6fa518bf5
[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   { "name" => "IO::Wrap", "url" => "http://search.cpan.org/~dskoll/IO-stringy-2.110/" },
17   { "name" => "Text::CSV_XS", "url" => "http://search.cpan.org/~hmbrand/Text-CSV_XS-0.29/" },
18   );
19
20 sub module_available {
21   my ($module) = @_;
22
23   if (!defined(eval("require $module;"))) {
24     return 0;
25   } else {
26     return 1;
27   }
28 }
29
30 sub test_all_modules {
31   return grep { !module_available($_->{name}) } @required_modules;
32 }
33
34 1;